后来想起来fibjs社区里响马提到用keep-alive测试一发,于是又跑了一遍测试
源码见上篇文章
fibjs
[bangbang93@10-4-14-175 ~]$ ab -n 100000 -c 500 -k http://server.bangbang93.com:12345/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking server.bangbang93.com (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software:
Server Hostname: server.bangbang93.com
Server Port: 12345
Document Path: /
Document Length: 16 bytes
Concurrency Level: 500
Time taken for tests: 57.423 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 100000
Total transferred: 12700000 bytes
HTML transferred: 1600000 bytes
Requests per second: 1741.47 [#/sec] (mean)
Time per request: 287.113 [ms] (mean)
Time per request: 0.574 [ms] (mean, across all concurrent requests)
Transfer rate: 215.98 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 11 334.1 0 31062
Processing: 25 275 502.9 257 17394
Waiting: 25 275 502.9 257 17394
Total: 25 286 608.6 257 32963
Percentage of the requests served within a certain time (ms)
50% 257
66% 262
75% 265
80% 267
90% 315
95% 430
98% 1126
99% 1960
100% 32963 (longest request)
db.fibjs.find().count()
100500
top里的
15206 bangbang 20 0 1680m 109m 5792 S 81.0 0.7 0:15.25 fibjs
nodejs
[bangbang93@10-4-14-175 ~]$ ab -n 100000 -c 500 -k http://server.bangbang93.com:12345/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking server.bangbang93.com (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software:
Server Hostname: server.bangbang93.com
Server Port: 12345
Document Path: /
Document Length: 16 bytes
Concurrency Level: 500
Time taken for tests: 86.984 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 0
Total transferred: 9100091 bytes
HTML transferred: 1600016 bytes
Requests per second: 1149.63 [#/sec] (mean)
Time per request: 434.921 [ms] (mean)
Time per request: 0.870 [ms] (mean, across all concurrent requests)
Transfer rate: 102.17 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 9 176 577.9 33 15048
Processing: 12 253 263.9 275 15218
Waiting: 12 253 263.6 275 15218
Total: 30 429 641.4 308 15333
Percentage of the requests served within a certain time (ms)
50% 308
66% 315
75% 323
80% 339
90% 1077
95% 1315
98% 1798
99% 3303
100% 15333 (longest request)
加了Keep-Alive之后fibjs的成绩才能看