Why set keepalive_timeout to a short period when Nginx is great at handling them?

Aahan Krish krish at aahan.me
Sat Jun 18 11:26:00 UTC 2016

I read something interesting today:

"Keep alive is a HTTP feature which allows user agents to keep the
connection to your server open for a number of requests or until the
specified time out is reached. This won’t actually change the
performance of our nginx server very much as it handles idle
connections very well. The author of nginx claims that 10,000 idle
connections will use only 2.5 MB of memory, and from what I’ve seen
this seems to be correct.""

So why is it that people on the web (and in IRC) still recommend
setting `keepalive_timeout` to a short period (< 30 seconds) when
Nginx can handle idle keep-alive connections like a champ (using very
little resources) while serving active ones? Is that bad advise?

I get this advise so often that I believe there must be something that
I am missing. What's it?

More information about the nginx mailing list