# Bad performance with static files + keepalive

**URL:** <https://www.ruby-forum.com/t/bad-performance-with-static-files-keepalive/237156>\
**Category:** NGINX\
**Created:** [October 26, 2013, 2:09pm UTC](https://www.ruby-forum.com/t/bad-performance-with-static-files-keepalive/237156 "2013-10-26T14:09:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [October 26, 2013, 2:09pm UTC](https://www.ruby-forum.com/t/bad-performance-with-static-files-keepalive/237156/1 "2013-10-26T14:09:56Z")

</div>

Hi List,

i have a strange performance-issue on a server that serves  
static-files only (http + https), if files are bigger than 5k:

- rps drops from 6500 rps (empty file) to 13 rps when requesting a file

> 

5k

- perftest with location /perftest/ is at 8000 rps (https) / 15000 rps  
(http)

- perftest with empty.html is 6500 rps (https) / 13000 rps (http)

- perftest with 5k script.js is 1500 rps (https) / 12000 rps (http)

- perftest with 30k script.js is 13 rps (https) / 300 rps (http)

- beside that bad performance we have a lot of complaints of  
slow servers and i can confirm that loading of these resouces takes up  
to 15  
seconds

- OS is SLES11.2, system is a kvm virtual-machine, 2 cores, 1GB ram,  
270mb  
free, 420mb cached

- fresh reboot

- no iowait

- no shortage of ram

- error\_log/debug shows nothing.

what i played with so far, with no improvements:

- open\_file\_cache
- keepalive\_requests 10…100000
- keepalive\_timeout
- sendfile/tcp\_\*
- various ssl\_ciphers (PFS is not needed here)
- different nginx-version (os is 1.0.10, self-compiled is 1.4.2)

i’m scratching my head an am wondering: what did i missed?  
there must be something … on similar setup with debian/ssl  
we receive an average of 4000 rps for static files with  
PFS-algos on.

## ssl/config

worker\_processes 2;

worker\_rlimit\_nofile 10000;

#error\_log /var/log/nginx/error.log;  
#error\_log /var/log/nginx/error.log notice;  
#error\_log /var/log/nginx/error.log info;

#pid /var/run/nginx.pid;

events {  
worker\_connections 1000;  
use epoll;  
multi\_accept on;  
}

http {  
include mime.types;  
default\_type application/octet-stream;

```
#log_format main '$remote_addr - $remote_user [$time_local] 

```

“$request”  
’  
# '$status $body\_bytes\_sent “$http\_referer” ’  
# ‘“$http\_user\_agent” “$http\_x\_forwarded\_for”’;

# access\_log off;

```
sendfile on;
tcp_nopush on;
tcp_nodelay on;

send_timeout 15s;

#keepalive_timeout 0s;
keepalive_timeout 15s;
keepalive_requests 10;

server_tokens off;

open_file_cache max=1000 inactive=20s;
open_file_cache_valid 60s;
open_file_cache_min_uses 2;
open_file_cache_errors on;

```

}

server {  
…

ssl\_session\_cache shared:SSL:10m;  
ssl\_session\_timeout 1440m;  
ssl\_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;

# ssl\_ciphers

ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM;

# ssl\_ciphers RC4:HIGH:!aNULL:!MD5;

#ssl\_ciphers  
ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECD  
HE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA2  
56:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-RC4-SHA:ECDHE-RSA-RC4-SHA:ECDH-ECDSA-RC4-SHA:ECDH-RSA-RC4-SHA:E  
CDHE-RSA-AES256-SHA:RC4-SHA:HIGH:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!CBC:!EDH:!kEDH:!PSK:!SRP:!kECDH;

ssl\_prefer\_server\_ciphers on;

ssl\_ciphers HIGH:!aNULL:!MD5:!kEDH:!kECDH;

location / {  
root /srv/htdocs/domain;  
expires 1w;

}

location /perftest {  
return 200;  
}

regards & thanx in advance

Posted at Nginx Forum:

> **[bad performance with static files + keepalive](https://forum.nginx.org/read.php?2,244146,244146#msg-244146)**
>
> Hi List, i have a strange performance-issue on a server that serves static-files only (http + https), if files are bigger than 5k: - rps drops from 6500 rps (empty file) to 13 rps when requesting a file \> 5k - perftest with location /perftest/ is...
