# Question on socket usage

**URL:** <https://www.ruby-forum.com/t/question-on-socket-usage/218833>\
**Category:** NGINX\
**Created:** [April 13, 2012, 8:50am UTC](https://www.ruby-forum.com/t/question-on-socket-usage/218833 "2012-04-13T08:50:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurdipe\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Gurdipe\_D](https://www.ruby-forum.com/u/Gurdipe_D)\
**Post date:** [April 13, 2012, 8:50am UTC](https://www.ruby-forum.com/t/question-on-socket-usage/218833/1 "2012-04-13T08:50:46Z")

</div>

Hi,

I am new to nginx. I was wondering if nginx uses one server-side socket  
for  
each  
connection request. That is if there are 100 http connections  
simultaneously active  
tp an nginx server would there be 100 sockets in use in nginx?  
Thanks, Andy

---

<div class="post-metadata">

**Author:** ![Andy\_Bartaman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2bfe46/32.png) [@Andy\_Bartaman](https://www.ruby-forum.com/u/Andy_Bartaman)\
**Post date:** [April 13, 2012, 5:21pm UTC](https://www.ruby-forum.com/t/question-on-socket-usage/218833/2 "2012-04-13T17:21:58Z")

</div>

On 04/13/12 10:50, Andy Bartaman wrote:

> I am new to nginx. I was wondering if nginx uses one server-side socket for each  
> connection request. That is if there are 100 http connections simultaneously  
> active  
> tp an nginx server would there be 100 sockets in use in nginx?

Yes, you are right.

In case if request proxied by nginx to upstream, take in account sockets  
used by  
upstream connections too.

If you wan to tune max sockets limit in OS, don’t forget about sockets  
in  
TIME\_WAIT state - this connections closed in nginx, but usually  
accounted in OS  
limits.

–  
Anton Y.
