# Connection timeout on download server

**URL:** <https://www.ruby-forum.com/t/connection-timeout-on-download-server/242913>\
**Category:** NGINX\
**Created:** [August 7, 2015, 3:44am UTC](https://www.ruby-forum.com/t/connection-timeout-on-download-server/242913 "2015-08-07T03:44:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [August 7, 2015, 3:44am UTC](https://www.ruby-forum.com/t/connection-timeout-on-download-server/242913/1 "2015-08-07T03:44:41Z")

</div>

Hi  
I have an nginx setup on multiple download servers. I’ve setup a monitor  
server to check my servers at interval and when the servers seem to be  
at  
their peak I get connection timeout from my servers. I’ve set limit\_conn  
64  
for each remote\_ip  
to make sure one user can’t hog the server.  
today when I was receiving the timeout warnings, I checked the stub  
status  
of my server and it seems the server connection is nowhere near it’s  
limits.  
This is the stub status page:  
Server 1:  
Active connections: 764  
server accepts handled requests  
326451 326451 346395  
Reading: 0 Writing: 604 Waiting: 160

Server 2:  
Active connections: 426  
server accepts handled requests  
538407 538407 576918  
Reading: 0 Writing: 418 Waiting: 8

However my config files are way too high:

worker\_processes 1;  
pid /run/nginx.pid;  
worker\_rlimit\_nofile 90000;

events {  
worker\_connections 64000;  
multi\_accept on;  
}  
http{  
#aio on; turned off for linux  
upload\_progress uploads 5m;  
sendfile off;  
output\_buffers 1 1m;  
directio 512;  
tcp\_nopush on;  
tcp\_nodelay on;  
types\_hash\_max\_size 2048;  
server\_tokens off;  
server\_names\_hash\_bucket\_size 128;  
variables\_hash\_max\_size 1024;

}  
server{  
…

# limit perip

limit\_rate\_after 1m;  
limit\_rate 96k;  
limit\_conn perip 64;  
}

nginx version: nginx/1.6.2  
Linux s17 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-3~deb8u1 (2015-04-24)  
x86\_64 GNU/Linux

Am I missing something? Is there another connection limitation I should  
know  
of?

Posted at Nginx Forum:

> **[connection timeout on download server](https://forum.nginx.org/read.php?2,260839,260839#msg-260839)**
>
> Hi I have an nginx setup on multiple download servers. I've setup a monitor server to check my servers at interval and when the servers seem to be at their peak I get connection timeout from my servers. I've set limit\_conn 64 for each remote\_ip to...
