excessive RAM consumption - memory leak

Todd HG lists at ruby-forum.com
Wed Feb 20 22:49:12 MSK 2008


I am using Nginx 0.5.35 on a server that has a Xeon 5130 dual core, 4 GB
of RAM, and 10,000 RPM HD. Nginx serves millions of large images per
day. Sometimes tens of millions in a day. Over the past week the server
has been experiencing record traffic. I am looking for a way to reduce
the amount of RAM consumed by Nginx, but still deliver images at the
same rate. The CPU cycles are at an acceptable level, but yesterday
Nginx nearly consumed all 4 GB of RAM before I had to reboot the server
under very heavy traffic. All this server does is serve images files
like jpeg, etc. Some of my configuration is below:

Since this is a dual core CPU I am using:

worker_processes  2;
        worker_connections  12000;
        use epoll; # This is a RedHat Enterprise Server 4

I also have:

    gzip on;
    sendfile       on;
    tcp_nopush     on;
    tcp_nodelay    on;
    keepalive_timeout  75 20;
    server_names_hash_bucket_size 128;

I have tried reducing the keepalive_timeout to close the connection
sooner, so that resources might be freed sooner, but it has no noticable
effect.

Can someone make some suggestions how I could handle the same traffic,
but manage the RAM usage better.
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list