Monday 19 September 2011

Analysing VPS memory usage

Sometimes cPanel may not give you an inaccurate measurement of your memory usage. However, there will be some tell tale signs which include; slow loading of your website, page cannot be displayed 404, internal server error 500 and the most obvious PHP out of memory allocation.

The most accurate measurement is via SSH using the 'top' command.

# top
// to sort by memory instead of CPU (default)
// Inside the top command, press “Shift + F”, then press ‘n’ to order by memory


During normal browsing of my Wordpress site, I am already using 66% of my RAM. My Wordpress site is set to pull feeds of several websites every four hours. I found out that each website that is pulled takes up to 50MB RAM. If I pulled three or more feeds, I sometimes found myself with zero free RAM. Although increasing RAM is the obvious solution, I have more than 40 feeds to pull, multiply it by 50MB, I will need about 2GB RAM!

The estimate may be on the high side but if my site was to grow to include more feeds, I will need more RAM. Cost is an issue and I have not taken into consideration the CPU usage.

1) I will be increasing my VPS memory by another 512MB (smallest denominator available)
2) Going to ask my web host is Spam Assassin is configured correctly because it is using almost 20% available memory.
3) Configure PHP to use 512MB, 640MB and 768MB RAM to check on the performance. I will ask the web host to configure 768MB RAM in php.ini in case another problem pop up.
4) Check and configure optimal settings for eAccelerator.

No comments:

Post a Comment