Web Hosting Talk







View Full Version : High memory usage...


major
12-04-2002, 01:40 PM
For the last week or so I have had problems with my server. During the day the memory usage have continued to rise just to finish off with crashing every night!

The crashes have now been stopped - they were caused by a cron job that was going through the log files!

However, memory usage is still extremely high! The server has 512 MB of memory and usage is now 90%+. Sites on the server are based on PHP and MySQL, activity is not that high and should not amount to 90% memory usage. Something seems to be 'bleeding' memory.

How do I find out what is going wrong, i.e. what is causing it ?!

jimroe
12-04-2002, 04:14 PM
Assuming that you are running Linux / Unix variant as it sounds like you are, then this is absolutely normal.

The Linux memory manager works completely differently than a Windows machine, and the OS will in short order consume all available physical memory - it will do this before any attempt is made to free up memory allocated to a terminated or inactive process.

zRedDice
12-04-2002, 04:32 PM
Check and see how much memory is buffered and how much is cached, and subtract that from what it says is being used. That should give you a much more accurate count.

James

major
12-04-2002, 04:35 PM
Thanks. I am running Redhat 7.1. I have just never seen memory usage like this before, and I have after all had dedicated servers for over a year now. Well, I guess I'll keep on monitoring it - and hopefully it is not going to crash again...

goodness0001
12-04-2002, 06:47 PM
Linux will start getting unstable when it has to move large amounts of data from memory into its swap and so forth causing it to get extremely slow or just crash.

nozol
12-04-2002, 08:51 PM
I suggest you check how much memory does each httpd process takes, using the 'top' utility. Normal values are 13-20 mb per process, or slightly higher. If it is much higher than that, sometimes it reaches 180 mb for each process, that is absolutely abnormal. In that case you need to restart apache

/etc/init.d/httpd restart

It is also recommended that you restart apache every once in a while.

hope this helps.

major
12-05-2002, 04:10 AM
Thanks, guys.

It's great to get recommendations like this - just what I have been looking for...