请教大神nginx负载问题 看全部

假如有ABCDE个相同配置和带宽主机。做负载均衡A为主服务器。那么流量大了。A主机相比较其他副主机的CPU内存带宽等是否承载更高?
  1. upstream HA {
  2. server AIP:port weight=10 max_fails=3 fail_timeout=5s;
  3. server BIP:port weight=10 max_fails=3 fail_timeout=5s;
  4. server CIP:port weight=10 max_fails=3 fail_timeout=5s;
  5. server DIP:port weight=10 max_fails=3 fail_timeout=5s;
  6. server EIP:port weight=10 max_fails=3 fail_timeout=5s;
  7. }

  8. server {
  9.     listen port;
  10.     server_name yourdomain.com;
  11.     ...
  12.     location ~ \.*$ {
  13.         proxy_pass http(s)://HA;
  14.         ...
  15.     }
  16.     ...
  17. }
本帖最后由 wangcan45 于 2017-9-4 10:57 编辑

nginx里有个weight 参数 可以设置权重 你都设成一样的权重  肯定不会负载更多
  • 3# pfdiy
  • 2017-9-4 11:01:17
楼上正确答案