I’m somewhat unclear about how the keepalive functionality works within
upstream module. My nginx install currently handles several hundred
all of which point to different origin servers. I would imagine I can
improve performance by enabling keepalive, however the documentation
"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,
there will potentially be up to 320 open connections from my server to
backend servers per worker at any given point or would the worker share
upstreams and only open a total of 32 regardless of how many upstream
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
they’re only evaluated on demand, but I don’t see any kind of
regarding how upstreams are handled.
Posted at Nginx Forum: