工具用 http_load,在公司的服务器上做的测试,我这边的带宽不是问题
我在云服务器上的 Rails 应用,nginx+passenger $ http_load -p 5 -s 10 urls 175 fetches, 5 max parallel, 1.48505e+06 bytes, in 10 seconds 8486 mean bytes/connection 17.5 fetches/sec, 148505 bytes/sec msecs/connect: 11.7533 mean, 100.123 max, 1.872 min msecs/first-response: 253.544 mean, 1797.26 max, 50.015 min HTTP response codes: code 200 -- 175
$ http_load -p 30 -s 10 urls 255 fetches, 30 max parallel, 2.16393e+06 bytes, in 10 seconds 8486 mean bytes/connection 25.5 fetches/sec, 216393 bytes/sec msecs/connect: 231.678 mean, 450.523 max, 1.917 min msecs/first-response: 595.631 mean, 2215.58 max, 142.245 min HTTP response codes: code 200 -- 255
$ http_load -p 30 -s 30 urls 784 fetches, 30 max parallel, 6.65302e+06 bytes, in 30 seconds 8486 mean bytes/connection 26.1333 fetches/sec, 221767 bytes/sec msecs/connect: 310.235 mean, 450.555 max, 2.066 min msecs/first-response: 481.559 mean, 1282.8 max, 133.443 min HTTP response codes: code 200 -- 784
$ http_load -p 50 -s 30 urls 780 fetches, 50 max parallel, 6.61908e+06 bytes, in 30 seconds 8486 mean bytes/connection 26 fetches/sec, 220636 bytes/sec msecs/connect: 518.74 mean, 750.023 max, 2.041 min msecs/first-response: 779.266 mean, 1890.49 max, 142.368 min HTTP response codes: code 200 -- 780
QPS 到 26 就上不去了,Latency 在不断变大 同时也测试了 ruby-china 和 codecampo 也是这样的