worker_connections exceed open file resource limit

Maxim Dounin mdounin at
Tue Mar 9 01:39:10 UTC 2021


On Sun, Mar 07, 2021 at 06:47:20PM -0500, bee.lists wrote:

> Big Sur has a warning that 1024 exceeds open file resource limit of 256.  
> Is this normal, considering I’ve set my worker_connections to 1024 in nginx.conf?
> Also, is this a package manager designation?

For production use, you should either set worker_connections below 
the limit, or raise the limit.  Without this, nginx might end up 
in a situation when it cannot accept new connections due to 
maxfiles limit being reached by the process, and cannot do 
anything with this.  And hence nginx prints the warning that your 
system is misconfigured.

Also, 1024 is somewhat low for any serious production use, so you 
probably want to raise the limit.  In simple cases just "ulimit 
-n" should be enough (or you can use worker_rlimit_nofile as an 
easier alternative,  In 
more complex cases you might need to adjust kernel limits, such as 
kern.maxfiles and kern.maxfilesperproc.  Some macOS-specific 
instructions can be found, for example, at (just the first link 
from Google "macos maxfiles", looks reasonable).

On the other hand, given macOS, this is highly unlikely going to 
be a production use, so you can safely ignore the warning.

Maxim Dounin

More information about the nginx mailing list