Welcome! Log In Create A New Profile

Advanced

Upstream Keepalive Questions

April 07, 2014 05:29PM
I'm somewhat unclear about how the keepalive functionality works within the upstream module. My nginx install currently handles several hundred domains all of which point to different origin servers. I would imagine I can improve performance by enabling keepalive, however the documentation says "The connections parameter sets the maximum number of idle keepalive connections to upstream servers that are preserved in the cache of each worker process. When this number is exceeded, the least recently used connections are closed. "

Does that mean that if I have 10 domains and then set keepalive to 32, that there will potentially be up to 320 open connections from my server to the backend servers per worker at any given point or would the worker share all upstreams and only open a total of 32 regardless of how many upstream blocks were on the website? Also, does the number of keepalive connections have anything to do with the number of cores on a box?

Also, is there any downside to having a large number of upstreams in the http block? I know for "map" block there's no performance degradation since they're only evaluated on demand, but I don't see any kind of documentation regarding how upstreams are handled.

Thanks!
Subject Author Posted

Upstream Keepalive Questions

abstein2 April 07, 2014 05:29PM

Re: Upstream Keepalive Questions

Maxim Dounin April 08, 2014 05:28AM

Re: Upstream Keepalive Questions

abstein2 April 08, 2014 05:41PM

Re: Upstream Keepalive Questions

Maxim Dounin April 09, 2014 07:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 281
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready