Tonic-_-

Member
Oct 16, 2010
8
0
51
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?
 

GaryT

Well-Known Member
May 19, 2010
320
3
68
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.
 

InterServed

Well-Known Member
Jul 10, 2007
273
17
68
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
 
Last edited: