nginx upstream fair

izghitu nginx-forum at
Wed Mar 10 18:05:40 MSK 2010


I have latest nginx on a 64bit CentOS running.

I use it as a load balancer in front of 2 apache servers.

The upstream config is the following:
upstream name {
    server apache1;
    server apache2;

server {
  listen       nginx:80;
  location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://name;

My problem is that the server that I put at the bottom in the upstream conf gets a lot less connections then the server that is first. When load testing and sending lots of connections to the nginx server I can see from the nginx error_log that the connections to apache1 time out but it still tries to send new ones to it while the apache2 server has few connections with nginx and gets few new connections.

If I change the order in the upstream then the problem still persists but with the other server.

Am I doing something wrong?

Please help.

Posted at Nginx Forum:,62274,62274#msg-62274

More information about the nginx mailing list