# Suggestions regarding number of connections

**URL:** <https://www.ruby-forum.com/t/suggestions-regarding-number-of-connections/213053>\
**Category:** NGINX\
**Created:** [October 21, 2011, 6:15pm UTC](https://www.ruby-forum.com/t/suggestions-regarding-number-of-connections/213053 "2011-10-21T18:15:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 21, 2011, 6:15pm UTC](https://www.ruby-forum.com/t/suggestions-regarding-number-of-connections/213053/1 "2011-10-21T18:15:04Z")

</div>

Currently we have a single Nginx web sever connecting to a pool of PHP  
app servers. The response from the application layer (PHP / DB) is  
excellent, but our site load times are not great. We’ve run some  
analytical tools and the network / web server response time is where a  
significant bottleneck exists.

In working with our managed hosting company on this issue, we ran the  
following shell commands. I was wondering if someone could give me an  
idea if these numbers are indicative of a configuration issue with OS  
and / or Nginx OR will more CPU power help with this problem OR maybe we  
need to load balance the traffic to another web server.

Should Nginx be able to handle this kind of traffic in general? Is there  
something that can be done in terms of Nginx configuration or OS  
configuration that can improve this issue (i.e. \> 7,000 connections  
waiting)?

root@server1 [~]# netstat -anp | grep ‘:80’ | grep ESTABLISHED -c  
4785  
Over 4000 current connections.

root@server1 [~]# netstat -anp | grep ‘:80’ | grep -i WAIT -c  
7982  
7000 Connections in waiting for data state.

root@server1 [~]# netstat -anp | grep ‘:80’ | grep -i SYN -c  
280

Posted at Nginx Forum:

> **[Suggestions regarding number of connections](https://forum.nginx.org/read.php?2,217026,217026#msg-217026)**
>
> Currently we have a single Nginx web sever connecting to a pool of PHP app servers. The response from the application layer (PHP / DB) is excellent, but our site load times are not great. We've run some analytical tools and the network / web server...

---

<div class="post-metadata">

**Author:** ![iberkner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/c67d28/32.png) [@iberkner](https://www.ruby-forum.com/u/iberkner)\
**Post date:** [October 22, 2011, 2:33am UTC](https://www.ruby-forum.com/t/suggestions-regarding-number-of-connections/213053/2 "2011-10-22T02:33:36Z")

</div>

I’ve seen an nginx server handle around 1 million concurrent  
connections. Set ulimit and do basic tcp tuning is generally good  
enough.

---

<div class="post-metadata">

**Author:** ![iberkner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/c67d28/32.png) [@iberkner](https://www.ruby-forum.com/u/iberkner)\
**Post date:** [October 22, 2011, 4:12am UTC](https://www.ruby-forum.com/t/suggestions-regarding-number-of-connections/213053/3 "2011-10-22T04:12:28Z")

</div>

That’s what I’m trying to understand. Could you give me some more  
specific  
examples of what to look for?

On Fri, Oct 21, 2011 at 8:32 PM, Brian A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’ve seen an nginx server handle around 1 million concurrent connections.  
> Set ulimit and do basic tcp tuning is generally good enough.
> 
> * * *
> 
> 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)

–

Ilan B.  
Chief Technology Officer

> **[Online Homeschool Curriculum from Time4Learning](https://www.time4learning.com/)**
>
> PreK-12 homeschooling is EASY with Time4Learning at your fingertips with award-winning online lessons, and parent-friendly planning and reporting tools.

6300 NE 1st Ave., Suite 203  
Ft. Lauderdale, FL 33334  
(954) 771-0914

[http://www.twitter.com/time4learning](http://www.twitter.com/time4learning)  
[http://www.facebook.com/Time4Learning](http://www.facebook.com/Time4Learning)

[Time4Learning.com](http://Time4Learning.com) - Online interactive curriculum for home use, PreK-8th  
Grade.  
[Time4Writing.com](http://Time4Writing.com) - Online writing tutorials for high, middle, and  
elementary  
school students.  
[Time4Learning.net](http://Time4Learning.net) - A forum to chat with parents online about kids,  
education, parenting and more.  
[spellingcity.com](http://spellingcity.com) - Online vocabulary and spelling activities for  
teachers,  
parents and students.
