# What's difference between worker\_connections and worker\_rlimit\_nofile

**URL:** <https://www.ruby-forum.com/t/whats-difference-between-worker-connections-and-worker-rlimit-nofile/185488>\
**Category:** NGINX\
**Created:** [March 21, 2010, 2:24pm UTC](https://www.ruby-forum.com/t/whats-difference-between-worker-connections-and-worker-rlimit-nofile/185488 "2010-03-21T14:24:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 21, 2010, 2:24pm UTC](https://www.ruby-forum.com/t/whats-difference-between-worker-connections-and-worker-rlimit-nofile/185488/1 "2010-03-21T14:24:05Z")

</div>

worker\_rlimit\_nofile for file descriptors and worker\_connections for  
network connections?  
If I am right, worker\_rlimit\_nofile must be larger than  
worker\_connections.

And, what’s the relationship between `ulimit -n’ and  
worker\_rlimit\_nofile?

–  
Ren Xiaolei

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 21, 2010, 7:52pm UTC](https://www.ruby-forum.com/t/whats-difference-between-worker-connections-and-worker-rlimit-nofile/185488/2 "2010-03-21T19:52:27Z")

</div>

Hello!

On Sun, Mar 21, 2010 at 09:23:33PM +0800, ä»»æ™“ç£Š wrote:

> worker\_rlimit\_nofile for file descriptors and worker\_connections for  
> network connections?  
> If I am right, worker\_rlimit\_nofile must be larger than worker\_connections.

worker\_rlimit\_nofiles adjusts system limit on number of open  
files in nginx worker, while worker\_connections is number of  
connections nginx will allow.

System limit on number of open files must be larger than number of  
worker\_connections as any connection opens at least one file  
(usually two - connection socket and either backend connection  
socket or static file on disk).

> And, what’s the relationship between `ulimit -n’ and worker\_rlimit\_nofile?

Via “ulimit -n” you may set the same system limit on number of  
open files. It doesn’t really matter which method is used to set  
limit (ulimit or worker\_rlimit\_nofile directive). Though  
sometimes worker\_rlimit\_nofile is more convenient as it allows to  
adjust limit without restarting nginx.

Maxim D.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 22, 2010, 1:24am UTC](https://www.ruby-forum.com/t/whats-difference-between-worker-connections-and-worker-rlimit-nofile/185488/3 "2010-03-22T01:24:19Z")

</div>

On Mon, Mar 22, 2010 at 2:52 AM, Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> sometimes worker\_rlimit\_nofile is more convenient as it allows to  
> adjust limit without restarting nginx.

## Thank you. I will add worker\_rlimit\_nofile into my nginx.conf file.

Ren Xiaolei
