The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Server memory being eaten alive..

Discussion in 'Workarounds and Optimization' started by Tonic-_-, Oct 29, 2010.

  1. Tonic-_-

    Tonic-_- Member

    Joined:
    Oct 16, 2010
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    I have a dedicated server with 8GB of RAM. The content I host heavily utilizes PHP/MySQL. I've optimized a few times (apache/MySQL). The thing is, the 8GB of memory gets eaten alive within hours. I will go from 7GB of ram to 305MB of ram within a 12 hour period. I can shut down apache and mySQL and run

    killall -9 php
    killall -9 mysqld

    but only about 2GB of ram is free.
    Is there any way to track the source that is eating the memory?
     
  2. GaryT

    GaryT Well-Known Member

    Joined:
    May 19, 2010
    Messages:
    321
    Likes Received:
    3
    Trophy Points:
    16
    This will show you the output of whats has been used recently.

    The memory will go down depending on the amount of users browsing the server / forums, Accelerators will increase memory usuage so if installed you may want to check on the configuration.

    eAccelerator on big websites has a tiny impact when using the default shm_size, I reduce this to around 1 or 2, Thats if your using it !

    For the mysql you should run the tuner for best settings:

    Install:

    Then Run:

    Do what it suggests, Then restart mysql once changes has been made, Leave it for atleast 24 hours and run the tuner again for further advice.
     
  3. InterServed

    InterServed Well-Known Member

    Joined:
    Jul 10, 2007
    Messages:
    255
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    Total ram usage by all processes:
    Code:
    ps ax -o comm= -o rss=|awk '{s+=$2};END{printf"%8.2f MB\n",s/1024}'
    Sort processes usage based on resource usage:
    Code:
    ps -eo pid,%cpu,%mem,cmd | sort +2 -3
    Watch top:
    Code:
    top -cd1
    then press shift+M while on top command to sort by memory usage.
    Look for VIRT RES and %MEM columns
     
    #3 InterServed, Nov 2, 2010
    Last edited: Nov 2, 2010
Loading...

Share This Page