Excessive RAM consumption - memory leak

Errr … you WANT the OS to cache stuff in ram otherwise you server
will slow to a crawl as every disk access is uncached.

Dave C. wrote:

Errr … you WANT the OS to cache stuff in ram otherwise you server
will slow to a crawl as every disk access is uncached.

Yes, you are correct Dave. I thought perhaps Elliot knew something about
Redhat 4 that I wasn’t aware of. All my packages are up to date, and I
haven’t seen any existing bugs that might cause a memory leak. I’ve
recorded the RAM usage of all running processes after the machine was
rebooted, and I’ll record the RAM usage again after the RAM fills up to
see which process is in fact the culprit. I’ll post the results in a day
or so, or as soon as the RAM is full.

Please excuse my bad english…

I use nginx version: nginx/0.5.35 built by gcc 4.1.1 (Gentoo 4.1.1-r3).
Load
average: 0.08, 0.06, 0.01. This server provide 10-12M/s images content.
And
my config is:

user nginx nginx;
worker_processes 8;
error_log off;

events {
worker_connections 24576;
use epoll;
}

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

    client_header_timeout   2m;
    client_body_timeout     2m;
    send_timeout            2m;

    connection_pool_size            1024;
    client_header_buffer_size       1k;
    large_client_header_buffers     4 4k;
    request_pool_size               4k;

    gzip off;

    output_buffers  1 32k;
    postpone_output 1460;

    sendfile        on;
    tcp_nopush      off;
    tcp_nodelay     off;

    keepalive_timeout       75 20;

    ignore_invalid_headers  on;

    index index.html;

    server {
            listen          My.IP;
            server_name     My.IP;
            access_log   off;
            root /storage;
            location / {
                    error_page 404 = @backend;
            }
            location @backend {
                    proxy_pass http://server2.my-domain.tld;
            }
    }

}


С уважение,
Й. Георгиев.

WEB: http://gigavolt-bg.net/
Blog: http://live.gigavolt-bg.net/

Yordan G. wrote:

Please excuse my bad english…

I use nginx version: nginx/0.5.35 built by gcc 4.1.1 (Gentoo 4.1.1-r3).

Thank you Yordan, I will try some of the settings from your config file.

btw i compile my nginx with “–without-http_charset_module
–without-http_ssi_module --without-http_auth_basic_module
–without-http_autoindex_module --without-http_geo_module
–without-http_map_module --without-http_limit_zone_module
–without-http_empty_gif_module --without-http_browser_module
–without-http_upstream_ip_hash_module”

On Fri, Feb 22, 2008 at 8:42 PM, Todd HG [email protected] wrote:

Yordan G. wrote:

Please excuse my bad english…

I use nginx version: nginx/0.5.35 built by gcc 4.1.1 (Gentoo 4.1.1-r3).

Thank you Yordan, I will try some of the settings from your config file.

Posted via http://www.ruby-forum.com/.


С уважение,
Й. Георгиев.

WEB: http://gigavolt-bg.net/
Blog: http://live.gigavolt-bg.net/

After a lot of analysis I have found that Nginx was not the source of
the memory leak.

After setting up cache-control this did help a lot with bandwidth. Is
there a way to setup cache control on the same server to deal with
caching images one way, and .html, .css, and .js files another way in
the nginx.conf?

On Tue, Feb 26, 2008 at 07:15:29AM +0100, Todd HG wrote:

After a lot of analysis I have found that Nginx was not the source of
the memory leak.

I suspect you has no memory leak at all. It’s very typical for Unix
systems
to keep free memory as small as possible (here is 11M only from 2G) :

last pid: 79350; load averages: 0.39, 0.46, 0.41 up 33+17:16:00
09:43:53
21 processes: 1 running, 20 sleeping
CPU states: 25.8% user, 0.0% nice, 11.4% system, 9.8% interrupt, 53.0%
idle
Mem: 103M Active, 1430M Inact, 378M Wired, 83M Cache, 63M Buf, 11M Free
Swap: 2096M Total, 4872K Used, 2091M Free

PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND
67776 nobody 1 4 -10 87168K 85572K kqread 799:58 32.91% nginx
843 root 1 96 0 5600K 728K select 2:04 0.00% sshd
814 root 1 96 0 4612K 736K select 0:59 0.00% ntpd

After setting up cache-control this did help a lot with bandwidth. Is
there a way to setup cache control on the same server to deal with
caching images one way, and .html, .css, and .js files another way in
the nginx.conf?

  location ~ \.(html|css|js)$ {
      expires ...
  }

  location ~ \.(jpg|jpeg|gif)$ {
      expires ...
  }