Reducing IO caused by nginx

Posted by glumbo on Server Fault See other posts from Server Fault or by glumbo
Published on 2011-11-17T20:36:17Z Indexed on 2011/11/18 1:53 UTC
Read the original article Hit count: 451

Filed under:
|

I have a lot of free RAM but my IO is always 100 %util or very close. What ways can I reduce IO by using more RAM? My iotop shows nginx worker processes with the highest io rate. This is a file server serving files ranging from 1mb to 2gb. Here is my nginx.conf

#user  nobody;
worker_processes  32;
worker_rlimit_nofile 10240;
worker_rlimit_sigpending 32768;

error_log  logs/error.log  crit;

#pid        logs/nginx.pid;


events {
    worker_connections  51200;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    access_log  off;
    limit_conn_log_level info;
    log_format  xfs  '$arg_id|$arg_usr|$remote_addr|$body_bytes_sent|$status';

    sendfile       off;
    tcp_nopush     off;
    tcp_nodelay on;
    directio 4m;
    output_buffers 3 512k;
    reset_timedout_connection on;
    open_file_cache max=5000 inactive=20s;
    open_file_cache_valid    30s;
    open_file_cache_min_uses 2;
    open_file_cache_errors   on;
    client_body_buffer_size 32k;

    server_tokens off;
    autoindex off;

    keepalive_timeout  0;
    #keepalive_timeout  65;

© Server Fault or respective owner

Related posts about nginx

Related posts about io