# How many connections can nginx handle?

**URL:** <https://www.ruby-forum.com/t/how-many-connections-can-nginx-handle/224370>\
**Category:** NGINX\
**Created:** [November 9, 2012, 4:47am UTC](https://www.ruby-forum.com/t/how-many-connections-can-nginx-handle/224370 "2012-11-09T04:47:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [November 9, 2012, 4:47am UTC](https://www.ruby-forum.com/t/how-many-connections-can-nginx-handle/224370/1 "2012-11-09T04:47:39Z")

</div>

I have a server running proxy\_pass the http request(mainly GET,html,jpg  
etc.) to backend server(20+ server running nginx cache).  
this server with 32 core CPU,64G RAM,2X 10G NIC,RHEL 6.3,backend server  
with  
1000M NIC.  
When the load raise to 300k connections,3Gbps network traffic,new  
connection  
can not be serviced,cannot connect to nginx’s port,but the system load  
is  
low(~1.00),and has many free memory,  
no errorlog in /var/log/message,has some nginx errorlog like"upstream  
timed  
out to backend server",  
but the backend’s service is normal,load is not hight…  
i have tune tcp config,can handle 2000K conn,it seems that nginx cannot  
handle so much connection?

nginx config:  
worker\_processes 32;use worker\_cpu\_affinity;  
keepalive 32 to backend servers,  
proxy\_buffering on or off has the same result…

Posted at Nginx Forum:

> **[How many connections can nginx handle?](https://forum.nginx.org/read.php?2,232623,232623#msg-232623)**
>
> I have a server running proxy\_pass the http request(mainly GET,html,jpg etc.) to backend server(20+ server running nginx cache). this server with 32 core CPU,64G RAM,2X 10G NIC,RHEL 6.3,backend server with 1000M NIC. When the load raise to 300k...

---

<div class="post-metadata">

**Author:** ![arnoldguo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@arnoldguo](https://www.ruby-forum.com/u/arnoldguo)\
**Post date:** [November 9, 2012, 10:47am UTC](https://www.ruby-forum.com/t/how-many-connections-can-nginx-handle/224370/2 "2012-11-09T10:47:40Z")

</div>

On 11/9/12 7:46 AM, arnoldguo wrote:

> i have tune tcp config,can handle 2000K conn,it seems that nginx cannot  
> handle so much connection?

How did you do that and how did you check that the OS can handle 2M  
tcp connections?

> nginx config:  
> worker\_processes 32;use worker\_cpu\_affinity;  
> keepalive 32 to backend servers,  
> proxy\_buffering on or off has the same result…

It’s almost always about tuning various OS limits not nginx.

As for nginx, this link is a good start:

> **[Core functionality](http://nginx.org/en/docs/ngx_core_module.html#worker_connections)**
>
> Sets the maximum number of simultaneous connections that can be opened by a worker process.

–  
Maxim K.  
+7 (910) 4293178

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.

---

<div class="post-metadata">

**Author:** ![arnoldguo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@arnoldguo](https://www.ruby-forum.com/u/arnoldguo)\
**Post date:** [November 12, 2012, 2:58am UTC](https://www.ruby-forum.com/t/how-many-connections-can-nginx-handle/224370/3 "2012-11-12T02:58:20Z")

</div>

## Maxim K. Wrote:

> load is  
> tcp connections?

I use a 3rd nginx PUSH module,and can get 2M nginx connections…

> –  
> Maxim K.  
> +7 (910) 4293178  
> [NGINX | F5](http://nginx.com/support.html)
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,232623,232712#msg-232712](http://forum.nginx.org/read.php?2,232623,232712#msg-232712)

---

<div class="post-metadata">

**Author:** ![arnoldguo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@arnoldguo](https://www.ruby-forum.com/u/arnoldguo)\
**Post date:** [November 12, 2012, 4:01am UTC](https://www.ruby-forum.com/t/how-many-connections-can-nginx-handle/224370/4 "2012-11-12T04:01:28Z")

</div>

On Friday 09 November 2012 07:46:50 arnoldguo wrote:

> […]  
> nginx config:  
> worker\_processes 32;use worker\_cpu\_affinity;  
> keepalive 32 to backend servers,  
> proxy\_buffering on or off has the same result…

> **[Core functionality](http://nginx.org/en/docs/ngx_core_module.html#worker_connections)**
>
> Sets the maximum number of simultaneous connections that can be opened by a worker process.

wbr, Valentin V. Bartenev

---

<div class="post-metadata">

**Author:** ![arnoldguo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@arnoldguo](https://www.ruby-forum.com/u/arnoldguo)\
**Post date:** [November 12, 2012, 9:31am UTC](https://www.ruby-forum.com/t/how-many-connections-can-nginx-handle/224370/5 "2012-11-12T09:31:38Z")

</div>

worker\_connections has been set to 1048576;  
As a reverse proxy situation, max clients becomes  
max clients = worker\_processes \* worker\_connections/4  
should handle 8 million connections，but on my server limit to 300k  
conn,what’s wrong?

Posted at Nginx Forum:

> **[Re: How many connections can nginx handle?](https://forum.nginx.org/read.php?2,232623,232718#msg-232718)**
>
> I have a server running proxy\_pass the http request(mainly GET,html,jpg etc.) to backend server(20+ server running nginx cache). this server with 32 core CPU,64G RAM,2X 10G NIC,RHEL 6.3,backend server with 1000M NIC. When the load raise to 300k...
