我正在两个服务图像的应用服务器前面运行一个that负载均衡器。问题是,如果我使用一台或两台服务器对性能没有影响(请参阅添加的图像)。我正在使用数字海洋作为副总裁的供应商。vps正在运行nginx和
用两个服务器加载:

使用1台服务器加载:

Haproxy配置看起来如下所示:
global
log 127.0.0.1 local0 notice
maxconn 10000
user haproxy
group haproxy
chroot /var/lib/haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
contimeout 5000
clitimeout 50000
srvtimeout 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
frontend www
bind 12.34.56.789:80
option http-server-close
default_backend web-backend
backend web-backend
balance roundrobin
server web-1 12.34.56.789:80 check
server web-2 12.34.56.789:80 check发布于 2015-12-01 19:28:22
如果您的应用程序花费太多时间发送响应,那么在负载均衡器后面添加更多的服务器将不会有帮助。
这是响应时间定律。
负载均衡器不会改善您的响应时间,因为他需要等待来自应用服务器的响应才能为客户端服务,在此期间,连接将保持建立和等待。
您的最大响应时间约为70秒,并且有+17000请求超时(这是不好的)。这是一个应用程序问题。
还要确保数据库能够处理这些连接的数量。
More application servers = more database connections。
https://serverfault.com/questions/734798
复制相似问题