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

We are using an nginx backend behind a nginx proxy.

We use upstream keepalives.

They work quite nicely.

We were wondering, what value would we set keepalive_requests on the backend to set the maximum number of keepalive requests to unlimited?


share|improve this question
up vote 4 down vote accepted

There is no special value to mean unlimited. Use some big number (up to 2147483647 on 32-bit platforms) instead.

share|improve this answer
yep, we have taken a look at the nginx source. nothing in there that would point to a value that sets keepalive_requests to unlimited. this will have to do. thanks! – anonymous-one Sep 7 '12 at 7:05
Maxim, and what's the point of not having an option to let infinite keep-alive? If a connection is actively used why would it have to be reopen every N http requests? – wick Dec 30 '14 at 12:30
@wick, the main reason is that there are some allocations from a connection memory pool which may happen, and the connection have to be closed to free the memory. – Maxim Dounin Jan 12 '15 at 12:46

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.