Apache的mod_proxy_balancer模块
Listen xxx
<IfModule !mpm_netware_module>
User daemon
Group daemon
</IfModule>
ServerName www.domain.com
<Location /balancer-manager>
SetHandler balancer-manager
Order Deny,Allow
Allow from all
</Location>
ProxyRequests off
<proxy>
Order deny,allow
Allow from all
</proxy>
ProxyPass / balancer://mytest/
<proxy balancer://mytest/>
BalancerMember http://xxx.xxx.xxx.xxx:xxx loadfactor=1
BalancerMember http://xxx.xxx.xxx.xxx:xxx loadfactor=1
</proxy>
Pound
LogLevel 3
ListenHTTP
Address xxx.xxx.xxx.xxx
Port xxx
Service
BackEnd
Address xxx.xxx.xxx.xxx
Port xxx
End
BackEnd
Address xxx.xxx.xxx.xxx
Port xxx
End
End
End
Nginx
worker_processes 1;
events {
worker_connections 1024;
}
http {
upstream myproject {
server xxx.xxx.xxx.xxx:xxx;
server xxx.xxx.xxx.xxx:xxx;
}
server {
listen xxx;
server_name www.domain.com;
location / {
proxy_pass http://myproject;
}
}
}
性能比较
以下所有测试采用apache bench
根据页面大小(50000请求量,300并发)
每秒响应数 | mod_proxy_balancer | Pound | Nginx |
小页面(Bytes) | 5625.815 | 2326.813 | 7268.268 |
中页面(KBytes) | 5624.462 | 2350.260 | 5985.835 |
大页面(MBytes) | 421.758(有个别失败请求[十万分之一]) | 404.426(有3-4%失败请求) | 410.733 |
根据请求数量(小页面(Bytes),300并发)
每秒响应数 | mod_proxy_balancer | Pound | Nginx |
50000 | 5625.815 | 2326.813 | 7268.268 |
100000 | 7168.442 | 2349.360 | 7254.587 |
200000 | 7782.378 | 2496.813 | 7566.883 |
根据并发量(小页面(Bytes),50000请求量)
每秒响应数 | mod_proxy_balancer | Pound | Nginx |
300 | 5625.815 | 2326.813 | 7268.268 |
500 | 3137.200 | 1928.617 | 7254.587 |
1000 | 5470.355 | 几乎全部失败请求 | 6789.280(99%以上失败请求) |
声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。