|
| 1 | +# t-io Benchmarking Test |
| 2 | + |
| 3 | +This is the tio-server portion of a [benchmarking test suite](../) comparing a variety of web development platforms. |
| 4 | + |
| 5 | +## Controller |
| 6 | + |
| 7 | +These implementations use the tio-server's controller. |
| 8 | + |
| 9 | +### Plaintext Test |
| 10 | + |
| 11 | +* [Plaintext test source](src/main/java/com/litongjava/tio/http/server/controller/IndexController.java) |
| 12 | + |
| 13 | +### JSON Serialization Test |
| 14 | + |
| 15 | +* [JSON test source](src/main/java/com/litongjava/tio/http/server/controller/IndexController.java) |
| 16 | + |
| 17 | +### Database Query Test |
| 18 | + |
| 19 | +* [Database Query test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java)) |
| 20 | + |
| 21 | +### Database Queries Test |
| 22 | + |
| 23 | +* [Database Queries test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java)) |
| 24 | + |
| 25 | +### Database Update Test |
| 26 | + |
| 27 | +* [Database Update test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java)) |
| 28 | + |
| 29 | +### Template rendering Test |
| 30 | + |
| 31 | +* [Template rendering test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java)) |
| 32 | + |
| 33 | +### Cache Query Test |
| 34 | +* [Cache query test source](src/main/java/com/litongjava/tio/http/server/controller/CacheController.java)) |
| 35 | + |
| 36 | + |
| 37 | +## Versions |
| 38 | +3.7.3.v20231218-RELEASE (https://gitee.com/litongjava/t-io) |
| 39 | + |
| 40 | +## Test URLs |
| 41 | + |
| 42 | +All implementations use the same URLs. |
| 43 | + |
| 44 | +### Plaintext Test |
| 45 | + |
| 46 | + http://localhost:8080/plaintext |
| 47 | + |
| 48 | +### JSON Encoding Test |
| 49 | + |
| 50 | + http://localhost:8080/json |
| 51 | + |
| 52 | +### Database Query Test |
| 53 | + |
| 54 | + http://localhost:8080/db |
| 55 | + |
| 56 | +### Database Queries Test |
| 57 | + |
| 58 | + http://localhost:8080/queries?queries=5 |
| 59 | + |
| 60 | +### Cache Query Test |
| 61 | + |
| 62 | + http://localhost:8080/cacheQuery?queries=10000 |
| 63 | + |
| 64 | +### Template rendering Test |
| 65 | + |
| 66 | + http://localhost:8080/fortunes |
| 67 | + |
| 68 | +### Database Update Test |
| 69 | + |
| 70 | + http://localhost:8080/updates?queries=5 |
| 71 | + |
| 72 | + ## Hot to run |
| 73 | + ### install mysql 8 |
| 74 | + - 1.please instal mysql 8.0.32,example cmd |
| 75 | + ``` |
| 76 | + docker run --restart=always -d --name mysql_8 --hostname mysql \ |
| 77 | +-p 3306:3306 \ |
| 78 | +-e 'MYSQL_ROOT_PASSWORD=robot_123456#' -e 'MYSQL_ROOT_HOST=%' -e 'MYSQL_DATABASE=hello_world' \ |
| 79 | +mysql/mysql-server:8.0.32 \ |
| 80 | +--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --lower_case_table_names=1 |
| 81 | + ``` |
| 82 | + - 2.create database schema hello_world |
| 83 | + - 3.create tablle,[example](sql/hello_world.sql) |
| 84 | + - 4.import data |
| 85 | + |
| 86 | + ### docker |
| 87 | + ``` |
| 88 | + docker build -t tio-server-benchmark -f tio-server.dockerfile . |
| 89 | +``` |
| 90 | +The run is to specify the mysql database |
| 91 | +``` |
| 92 | +docker run --rm -p 8080:8080 \ |
| 93 | +-e JDBC_URL="jdbc:mysql://192.168.3.9/hello_world" \ |
| 94 | +-e JDBC_USER="root" \ |
| 95 | +-e JDBC_PSWD="robot_123456#" \ |
| 96 | +tio-server-benchmark |
| 97 | +``` |
| 98 | + |
| 99 | +### windows |
| 100 | + |
| 101 | +-windows |
| 102 | +``` |
| 103 | +D:\java\jdk1.8.0_121\bin\java -jar target\tio-server-benchmark-1.0.jar --JDBC_URL=jdbc:mysql://192.168.3.9/hello_world?useSSL=false --JDBC_USER=root --JDBC_PSWD=robot_123456# |
| 104 | +``` |
| 105 | +or |
| 106 | +``` |
| 107 | +set JDBC_URL=jdbc:mysql://192.168.3.9/hello_world |
| 108 | +set jdbc.user=root |
| 109 | +set JDBC_PSWD=robot_123456# |
| 110 | +D:\java\jdk1.8.0_121\bin\java -jar target\tio-server-benchmark-1.0.jar |
| 111 | +``` |
| 112 | + |
| 113 | + |
| 114 | + |
0 commit comments