Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an application built using Tornado, running on two 16 core servers with a frontend server with Nginx on. The deployment guidelines for Tornado suggest one instance of the app per CPU cure so I have, in total, 32 instances of the application running.
The problem I'm having with Nginx is that if something goes wrong with the app servers that causes all the instances to be unavailable (Causing a connect timeout), NGINX goes through each one of the 32 instances and checks it before returning an error. The connect timeout is set to 5 seconds so it would be over 2:30 mins before NGINX actually sent something back to the user saying it had failed.
Is there any way to limit the number of servers NGINX will retry before sending an error to the user? I.E. it checks two servers then just gives up rather than cycling through all of them?

share|improve this question
up vote 0 down vote accepted

You could add another layer of proxies by setting up nginx at each backend server so frontend will have only two servers listed in its upstream section instead of 32.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.