Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Oct 2010
    Posts
    8

    Default Server memory being eaten alive..

    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. #2
    Member
    Join Date
    May 2010
    Posts
    321

    Default

    WHM > Server Status > Daily Process Log
    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:

    wget mysqltuner.pl
    Then Run:

    perl mysqltuner.pl
    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. #3
    Member InterServed's Avatar
    Join Date
    Jul 2007
    Posts
    172
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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
    Last edited by InterServed; 11-02-2010 at 02:20 PM.

Similar Threads & Tags
Similar threads

  1. Keep alive or death
    By Massoud in forum Optimization
    Replies: 0
    Last Post: 03-07-2011, 06:54 AM
  2. keep-alive ignored by WHM/
    By freakin'me in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-29-2006, 06:01 AM
  3. Gameserver.domain.com redirect to already alive game server
    By Douglas_Bartlet in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-21-2006, 02:55 PM
  4. Email to hotmail gets eaten...
    By DN-Paul in forum cPanel and WHM Discussions
    Replies: 21
    Last Post: 02-23-2004, 05:51 PM
  5. Apache dead or alive?
    By casey in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 03-16-2003, 01:27 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube