I had a VPS with DirectAdmin running on CentOS 5.7 with 512 MB RAM with Apache and MySQL. The problem I was having with it was that it was using around 115 MB RAM upon boot and this was rising to 200 MB after a while. Every 3 or 4 days the VPS was crashing and when I looked at the system log I kept seeing out of memory issues and this is what was causing the crash so what I did yesterday was upgrade this to a 1024 MB package thinking 1 GB of memory should be enough.
But now it still starts with 115 MB but eventually rises to 700 MB. I don't understand why it's not going down? I am guessing it will continue to rise till it touches 1 GB and crash again.
My impression was that a web server would work as follows:
- Starts with x amount of memory
- Stays at x amount of memory
- A website request is made so the server fires up whatever is required to process this request and uses y amount of memory. Once the request has been served, it goes back to x amount of memory
But in my case, it seems once it reaches y amount of memory, it says there even if no requests are being made.
Would appreciate if anyone could point me to the right direction.
Hi. I looked into that but it doesn't seem to be the cause. I have kept an eye on this since yesterday and it doesn't look like this is being caused by apache or mysql. I think it's something else. Output of ps is here: http://pastebin.com/8jqTgETZ
Here is my analysis of the output:
pop3-login = 1.6% / 16.38 MB imap-login = 1.6% / 16.38 MB mysqld = 16% / 163.84 MB httpd = 3.3% / 33.79 MB
This basically remains consistent. So I don't understand what it is that's not consuming memory in the beginning for a while but is starting to eat memory afterwards.
Last night (12 hours back) before going to bed, the system was using around 500 MB of memory. Now it's using 900 MB. 100 MB more and it will again run out of memory.