# Worker\_connections are not enough

**URL:** <https://www.ruby-forum.com/t/worker-connections-are-not-enough/219908>\
**Category:** NGINX\
**Created:** [May 21, 2012, 5:18pm UTC](https://www.ruby-forum.com/t/worker-connections-are-not-enough/219908 "2012-05-21T17:18:48Z")\
**Posts on this page:** 5\
**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:** [May 21, 2012, 5:18pm UTC](https://www.ruby-forum.com/t/worker-connections-are-not-enough/219908/1 "2012-05-21T17:18:48Z")

</div>

Hi

I am working with nginx and everything works fine!  
But when i set the worker\_connections down on (for example 11) the page  
can’t load completely (some pictures are missing). In the error-log is  
following error: worker\_connections are not enough.  
The apache-benchmark can even handle 4 requests on 11 worker\_connections  
without any error. (ab -n 100 -c 4…)  
I just have one client. I am using proxy\_pass/proxy\_redirect. In my mind  
I can use only 4 worker\_connections  
([http://wiki.nginx.org/EventsModule](http://wiki.nginx.org/EventsModule)). But with 4 worker\_connection the  
browser can’t load anything. (a blank page is the result)  
In my mind the request gets cancelled.  
Is this normal, is this a bug or is this my fault?

Thanks  
Bernhard

Posted at Nginx Forum:

> **[worker\_connections are not enough](https://forum.nginx.org/read.php?2,226691,226691#msg-226691)**
>
> Hi I am working with nginx and everything works fine! But when i set the worker\_connections down on (for example 11) the page can't load completely (some pictures are missing). In the error-log is following error: worker\_connections are not enough....

---

<div class="post-metadata">

**Author:** ![bernhardp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/4af34b/32.png) [@bernhardp](https://www.ruby-forum.com/u/bernhardp)\
**Post date:** [May 21, 2012, 5:45pm UTC](https://www.ruby-forum.com/t/worker-connections-are-not-enough/219908/2 "2012-05-21T17:45:32Z")

</div>

> But when i set the worker\_connections down on (for example 11) the page can’t  
> load completely (some pictures are missing). In the  
> error-log is  
> following error: worker\_connections are not enough.

What is the reason to set worker\_connections so low? (in general what’s  
the reason to set it anything below 1024 even?).

> But with 4 worker\_connection the browser can’t load anything. (a blank page is  
> the result)

Modern browsers usually try to open more than those 4 connections to a  
single host and that’s not even counting some “hanged/stray”  
ones:

Firefox 4.x: 6  
Firefox 3.6.x: 6  
Internet Explorer 9.x: 6  
Internet Explorer 8.x: dialup: 2, broadband: 6  
Chrome 11.x: 6  
Chrome 10.x: 6  
Opera 11.x: 8  
Safari 5.x: 6

rr

---

<div class="post-metadata">

**Author:** ![bernhardp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/4af34b/32.png) [@bernhardp](https://www.ruby-forum.com/u/bernhardp)\
**Post date:** [May 21, 2012, 5:49pm UTC](https://www.ruby-forum.com/t/worker-connections-are-not-enough/219908/3 "2012-05-21T17:49:53Z")

</div>

Hello!

On Mon, May 21, 2012 at 11:18:25AM -0400, bernhardp wrote:

> ([GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/EventsModule)). But with 4 worker\_connection the  
> browser can’t load anything. (a blank page is the result)  
> In my mind the request gets cancelled.  
> Is this normal, is this a bug or is this my fault?

This is normal. Connection structures are used for listen  
sockets, internal control sockets between nginx processes, and for  
upstream connections. So with 1 worker process and one listen  
socket there will be at least 2 connections used from very start,  
and to handle 4 client connections with proxy\_pass you need  
worker\_connections set to at least (2 + 4 + 4) = 10.

Maxim DOunin

---

<div class="post-metadata">

**Author:** ![bernhardp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/4af34b/32.png) [@bernhardp](https://www.ruby-forum.com/u/bernhardp)\
**Post date:** [May 22, 2012, 8:45am UTC](https://www.ruby-forum.com/t/worker-connections-are-not-enough/219908/4 "2012-05-22T08:45:00Z")

</div>

Ok. Thanks for your quick replies.  
I set the worker\_connections down to check the performance of nginx.  
Can anybody tell me how nginx is working with over 1000 requests at the  
same time, are there any common problems and how is the performance?  
Is it normal that nginx cancel the request (that the page isn’t loading  
completely)?

Posted at Nginx Forum:

> **[Re: worker\_connections are not enough](https://forum.nginx.org/read.php?2,226691,226704#msg-226704)**
>
> Hi I am working with nginx and everything works fine! But when i set the worker\_connections down on (for example 11) the page can't load completely (some pictures are missing). In the error-log is following error: worker\_connections are not enough....

---

<div class="post-metadata">

**Author:** ![bernhardp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/4af34b/32.png) [@bernhardp](https://www.ruby-forum.com/u/bernhardp)\
**Post date:** [June 14, 2016, 9:56am UTC](https://www.ruby-forum.com/t/worker-connections-are-not-enough/219908/5 "2016-06-14T09:56:31Z")

</div>

So in this case the worker\_connections should be set to at least (2 + 4

- 
  1. 

= 10. But what should be the optimal value for this? What are the  
implications of using a high number of worker connections in this case?

Posted at Nginx Forum:

> **[Re: worker\_connections are not enough](https://forum.nginx.org/read.php?2,226691,267552#msg-267552)**
>
> Hi I am working with nginx and everything works fine! But when i set the worker\_connections down on (for example 11) the page can't load completely (some pictures are missing). In the error-log is following error: worker\_connections are not enough....
