Questions regarding worker_connections

Maxim Dounin mdounin at mdounin.ru
Mon Aug 27 11:56:15 UTC 2018


Hello!

On Fri, Aug 24, 2018 at 02:54:31PM -0700, Alder Netw wrote:

> Got a question regarding the worker_connections configuration. Is a
> worker_connection
> essentially
> a tcp socket connection or http session?

The worker_connections directive configures maximum number of 
connections a worker process can open.  That is, basically this 
means "TCP sockets".

See http://nginx.org/r/worker_connections for additional details.

> Via the http_stub_status_module, I can see there are
> connections in waiting state, but any new request
> will result in a "worker connections are not enough"
> alert in error.log. Why it cannot accept new connections
> if there are existing connections in waiting state? Is that
> a bug? I am using nginx 1.6.2.

Connections in the waiting state are real established connections.  
While in some cases nginx can close and re-use these connections 
quickly enough to don't trigger the "worker connections are not 
enough" alert, this is not something guaranteed.

In general, you should tune worker_connections so it's higher than 
expected number of active connections - that is, all connections 
including waiting ones.

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx mailing list