linux ram

linux ram

dmmcintyre3dmmcintyre3 Member
edited August 2011 in General

Some nginx ram oddities

     PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
19587 nginx     15   0 24296  17m 1300 S  2.3 14.7  20:26.89 nginx  

it's the biggest ram consuming process, using more than MySQL or 1 PHP process unless I'm looking at something wrong. Then I went back after writing most of this post and it was down to 6mb. Last night I saw 57mb in the RES column for nginx.

Also, free -m reports less ram used than the use reported by the RES column for just the top 5 processes.

image

FreeVPS.us - The oldest post to host VPS provider
Tagged:

Comments

  • skagerrakskagerrak Member
    edited August 2011

    Edit says: Wrong answer.

  • This is a KVM VPS.

    FreeVPS.us - The oldest post to host VPS provider
  • Yeah something looks wrong. On my main site with Nginx serving ~80 requests/sec, the memory rarely goes over 6MB RSS for Nginx. As you are using PHP-FPM with persisting FastCGI connection, maybe that is building up the memory? For example try to turn that off, or use the regular PHP/FastCGI.

    Nginx can also build up memory usage if you keep large buffers in memory. Check whether you have very large fastcgi_buffer_size in your config?

    Blog at LowEndBox.com.

  • I am using php-fpm which sometimes spawns a third process, but it's normally just 2 processes.

    In the fastcgi_parms file, main nginx config and the php there is no fastcgi_buffer_size.

    FreeVPS.us - The oldest post to host VPS provider
Sign In or Register to comment.