New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
The site gets very few visitors.
Are you running a GUI on the server? If you are, that's probably the source of a lot of RAM usage. Are there any services running that don't need to be?
No gui on the server. no i run only apache mysql and related services for a basic websites.
I did some testing. I restarted apache and memory usage was normal.
then i tried loading pages of my site, with every page load the free memory usage kept dropping. maybe apache not releasing memory after it is done?
MySQL probably causing RAM hog.
Are you actually counting traffic or assuming little to no visitors? A page that isn't cached and is getting crawled by bots can generate a lot of memory usage from php and MySQL.
I say this because a lot of people assume traffic based on visitor interaction and don't actually parse the access logs.
Apache+MySQL, usually use more memory. Have you trim the Apache and MySQL configuration?
after running top, can you press shift + m to show the processes which uses the most ram and take a screenshot of it?
nginx + php5-fpm + mysql-server = 60-100mb ram for big dynamic websites for me.
try to use it.
Is KeepAlive on? This can cause high memory usage. Also you can remove Apache modules which you do not require.
KeepAlive is Off
output of shift -m on top
So reduce the number of apache workers... and edit the httpd config a bit to keep the usage down. Mysql is only using 20mb looking at that.
Better still use nginx + php-fpm, much faster than apache
Apache is fine people just don't like to configure where they don't have to. Reducing the number of minimum workers is the answer.
Too much memory consumed with php module in apache and prefork mpm. That is my bet.
Better use fast-cgi(or variants) than this module.
Also check if you are using opcode cache/accelerator while using libapache2-mod-php5...
and there you got your answer?
Thanks everyone. I have reduced the startservers and Maxclients attribute and it seems to be fine. I will still monitor it for some time and see if it reoccurs.
Also trying a setup of nginx on my spare vps, if all goes well will replace apache with nginx on my main vps too.