apache2.2.4的mod_proxy_balancer测试
有两台服务器为Server Version: Apache/2.2.4 (Unix) mod_apreq2-20051231/2.6.0 mod_perl/2.0.3 Perl/v5.8.8
ProxyRequests Off
<proxy balancer://test>
BalancerMember http://192.168.1.199 loadfactor=1
BalancerMember http://192.168.58.2:8080 loadfactor=1
</proxy>
测试应用程序
ab -c 5 -n 1000 http://www.imx4.com/album/api.mpl
单机测试结果理想:
第一台主机http://192.168.58.2:8080
Requests per second: 113.68 [#/sec] (mean)
Time per request: 43.984 [ms] (mean)
Time per request: 8.797 [ms] (mean, across all concurrent requests)
Transfer rate: 39.67 [Kbytes/sec] received
第二台主机http://192.168.1.199
Requests per second: 90.01 [#/sec] (mean)
Time per request: 55.547 [ms] (mean)
Time per request: 11.109 [ms] (mean, across all concurrent requests)
Transfer rate: 35.83 [Kbytes/sec] received
负载均衡后
LoadBalancer Status for balancer://test
StickySession Timeout FailoverAttempts Method
0 2 byrequests
Worker URL Route RouteRedir Factor Set Status Elected To From
http://192.168.1.199 1 0 Ok 276 65K 38K
http://192.168.58.2:8080 1 0 Ok 274 66K 25K
负载均衡测试结果
Requests per second: 55.70 [#/sec] (mean)
Time per request: 89.766 [ms] (mean)
Time per request: 17.953 [ms] (mean, across all concurrent requests)
Transfer rate: 20.83 [Kbytes/sec] received
结果好差啊。不知道其它同好的测试是什么样的 ,听说HAproxy 1.3.9不错,想知道该怎么用呢。