sanic golang nodejs thinkjs python 性能测试

版本信息:
系统: centos 6.7 64位 1核 2G 带宽1M
---
python [3.6.5]
tornado [5.0.2] ------ 使用了orm
uvloop [0.10.1]
sanic [0.7.0] -------- 使用了orm
---
node [10.1.0]
thinkjs [3.2.3] -------使用了orm
---
golang [1.10.1]
gin [1.2] -------------没有使用orm
---

逻辑: 从数据库里面取一个值

##################################################################################################
ab -c 500 -n 50000 http://df.163py.com:7619/
tornado-uvloop:
Server Software: TornadoServer/5.0.2
Server Hostname: df.163py.com
Server Port: 7619

Document Path: /
Document Length: 15 bytes

Concurrency Level: 500
Time taken for tests: 237.917 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 10500210 bytes
HTML transferred: 750015 bytes
Requests per second: 210.16 [#/sec] (mean)
Time per request: 2379.175 [ms] (mean)
Time per request: 4.758 [ms] (mean, across all concurrent requests)
Transfer rate: 43.10 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 14 275 595.0 26 15061
Processing: 19 2050 2812.0 1914 137909
Waiting: 19 2046 2787.9 1912 137909
Total: 33 2325 2873.5 1980 137938

Percentage of the requests served within a certain time (ms)
50% 1980
66% 2139
75% 2693
80% 2935
90% 3608
95% 4070
98% 5286
99% 6674
100% 137938 (longest request)

####################################################################################################
ab -c 500 -n 50000 http://df.163py.com:7619/
sanic[0.7.0]:
Server Software:
Server Hostname: df.163py.com
Server Port: 7619

Document Path: /
Document Length: 39 bytes

Concurrency Level: 500
Time taken for tests: 215.089 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 6450516 bytes
HTML transferred: 1950156 bytes
Requests per second: 232.46 [#/sec] (mean)
Time per request: 2150.886 [ms] (mean)
Time per request: 4.302 [ms] (mean, across all concurrent requests)
Transfer rate: 29.29 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 14 429 542.1 27 5040
Processing: 23 1710 598.0 1665 30112
Waiting: 22 1702 593.6 1663 30112
Total: 37 2139 824.7 1713 30140

Percentage of the requests served within a certain time (ms)
50% 1713
66% 2651
75% 2677
80% 2718
90% 2873
95% 2946
98% 3758
99% 4318
100% 30140 (longest request)

######################################################################################################
ab -c 500 -n 50000 http://df.163py.com:7619/home/hrecord/test/
thinkjs:
Server Software:
Server Hostname: df.163py.com
Server Port: 7619

Document Path: /home/hrecord/test/
Document Length: 39 bytes

Concurrency Level: 500
Time taken for tests: 188.990 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 10201020 bytes
HTML transferred: 1950195 bytes
Requests per second: 264.56 [#/sec] (mean)
Time per request: 1889.904 [ms] (mean)
Time per request: 3.780 [ms] (mean, across all concurrent requests)
Transfer rate: 52.71 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 14 483 865.8 27 11082
Processing: 16 1226 3521.9 456 63105
Waiting: 15 1081 3545.0 223 63105
Total: 30 1709 3708.9 720 64134

Percentage of the requests served within a certain time (ms)
50% 720
66% 1425
75% 1796
80% 2135
90% 3761
95% 5049
98% 8756
99% 15612
100% 64134 (longest request)

######################################################################################################
ab -c 500 -t 60 http://df.163py.com:7620/persons [不知道为什么golang跑总是超时,最后改为-t 60]
golang-gin:
Server Software:
Server Hostname: df.163py.com
Server Port: 7620

Document Path: /persons/
Document Length: 43 bytes

Concurrency Level: 500
Time taken for tests: 60.003 seconds
Complete requests: 16195
Failed requests: 0
Write errors: 0
Non-2xx responses: 16199
Total transferred: 3142606 bytes
HTML transferred: 696557 bytes
Requests per second: 269.91 [#/sec] (mean)
Time per request: 1852.503 [ms] (mean)
Time per request: 3.705 [ms] (mean, across all concurrent requests)
Transfer rate: 51.15 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 14 116 770.4 26 31097
Processing: 14 394 1969.7 29 50292
Waiting: 14 382 1970.9 28 50292
Total: 28 510 2125.9 60 50320

Percentage of the requests served within a certain time (ms)
50% 60
66% 142
75% 320
80% 342
90% 1042
95% 1722
98% 3614
99% 7328
100% 50320 (longest request)


最终: 每个请求多少毫秒
golang[3.705ms]>thinkjs[3.780ms]>sanic[4.302ms]>tornado[4.758ms]


分享到: 微信 更多