简单的压力测试采用Apache ab,500并发用户,10w的请求总数。
| 总耗时(s) | TPS(#/sec) |
LVS-NAT | 22.480 | 4448.34 |
LVS-TUNNEL | 10.707 | 9339.80 |
LVS-DR | 10.177 | 9825.68 |
HA-2Node | 21.387 | 4675.61 |
HA-5Node | 27.371 | 3653.37 |
l 静态页面 搜狐首页
LIGHTTPD
n/-c(ab参数) | cpu% | Mem | RequestsperSecond | Time taken for tests |
100000/100 | 64 | 60 | 462.75 | 21.6 |
100000/200 | 67 | 60 | 312.07 | 32.4 |
100000/500 | 83 | 60 | 137.24 | 72.8 |
100000/1000 出现错误丢包 | 94 | 60 | 126.6 | 78.9 |
NGINX
n/-c(ab参数) | cpu% | Mem | RequestsperSecond | Time taken for tests |
100000/100 | 34.6 | 140 | 943.66 | 10.597 |
100000/200 | 35.6 | 110 | 924.32 | 10.818 |
100000/500 | 34.3 | 110 | 912.68 | 10.956 |
100000/1000 | 37 | 160 | 832.59 | 12.106 |
APACHE
n/-c(ab参数) | cpu% | Mem | RequestsperSecond | Time taken for tests |
100000/100 | 40.6 | 170 | 690.72 | 14.47 |
100000/200 | 41.1 | 180 | 685.39 | 14.59 |
100000/500 | 42.3 | 190 | 633.64 | 15.78 |
100000/1000 | 43.1 | 200 | 547.53 | 18.26 |
l 动态页面 内部社区首页
LIGHTTPD
n/-c(ab参数) | cpu% | Mem | RequestsperSecond | Time taken for tests |
1000/100 | 50 | 200 | 33.54 | 29.816 |
1000/200 | 52 | 210 | 30.43 | 32.858 |
1000/500 | 54 | 230 | 25.79 | 38.76 |
1000/1000 | 62 | 250 | 24.83 | 40.28 |
NGINX
n/-c(ab参数) | cpu% | Mem | RequestsperSecond | Time taken for tests |
1000/100 | 53.8 | 250 | 83.12 | 12.305 |
1000/200 | 55.8 | 250 | 74.05 | 13.504 |
1000/500 | 56 | 260 | 58.99 | 16.951 |
1000/1000 | 58 | 260 | 43.41 | 23.347 |
APACHE
n/-c(ab参数) | cpu% | Mem | RequestsperSecond | Time taken for tests |
100000/100 | 60 | 200 | 27.37 | 36.541 |
100000/200 | 61 | 220 | 23.82 | 41.981 |
100000/500 | 73 | 150 | 20.59 | 48.562 |
100000/1000 | 53 | 200 | 27.18 | 36.796 |
l PHPINFO函数页
LIGHTTPD
n/-c(ab参数) | cpu% | Mem | RequestsperSecond | Time taken for tests |
100000/100 | 45 | 20 | 168.06 | 59.504 |
100000/200 | 47 | 22 | 140.64 | 71.103 |
100000/500 | 49 | 24 | 52.80 | 189.386 |
100000/1000 | 在请求到4840时测试测试程序死掉 |
NGINX
n/-c(ab参数) | cpu% | Mem | RequestsperSecond | Time taken for tests |
100000/100 | 70 | 120 | 143.46 | 69.706 |
100000/200 | 72 | 130 | 140.57 | 71.140 |
100000/500 | 73 | 150 | 135.87 | 73.601 |
100000/1000 | 77 | 160 | 132.18 | 75.657 |
APACHE出现丢包
n/-c(ab参数) | cpu% | Mem | RequestsperSecond | Time taken for tests |
100000/100 | 70 | 180 | 245.73 | 40.694 |
100000/200 | 72 | 190 | 245.79 | 40.684 |
100000/500 | 75 | 200 | 241.29 | 41.443 |
100000/1000 | 77 | 220 | 236.74 | 42.239 |
HA-2Node为配置了两个节点作为后段的服务节点,HA-5Node为配置了5个节点作为后端的服务处理节点。上面结果看到2个节点的HA反而比5个节点的速度来的快,同时HA在7层的转发和LVS-NAT性能相近。
HA-Proxy使用下来,总体上感觉比较简单,但功能却十分强大,但是性能方面来说需要关注在多节点和高压力的情况下的表现。