I have a VPS with 384 MB RAM where I host some PHP sites with constant traffic. I don't have diggs or other kind of traffic spikes going on. Here is my problem: the memory used keeps increasing CONSTANTLY over a week or two, then the VPS gets slow and the hosting company does something to reset its memory back again. I'll attach a graph to see exactly what I mean. Is this my fault or the server (VPS) is not configured properly? I'm thinking that if this would be caused by my websites then there should be daily increases (for peak hours) not a constant one over an entire week. The VPS has a default LAMP setup and it is managed by the hosting company.
The problem can also be regarding the mysql dead session related to some site. They might just be restarting services to reset things..
I don't add content daily. But the websites are dynamic so they get updated either by me or users. webhost.uk.net, can you please give me more details about the mysql dead session you were talking about? Regarding restarted services, Apache has been up and running throughout the memory usage drops visible in the graph. Whatever they do, is not about restarting the vps (or apache).
I would look at your configuration concerning caching for php and mysql. They might be set up to use too much memory. Also consider whatever php optimizers you are using. Also check to see if apache, php, or mysql are leaking memory? What distro are you using? Have you checked for memory leak bug reports?
Did you forget that linux puts a lot of memory into buffers/cache? Get munin or hotsanic graphs on, check out how much is being buffered/cached. Is the VPS going into swap at all?
You should have a memory leak somewhere, ie a daemon or any resident program that doesn't free your memory. Quiet common with Windows systems, unusual with Linux. Check every process you have (ps aux) to isolate the process consumming your memory and upgrade it to an earlier release. Hope this helps. Thibaut
At least with Linux, you should look around the bugs submitted for your distro. Often if there is a memory leak, not only will it be mentioned there but also there will be a work around for it. Good luck getting your problem solved, let us know how we can help.
I normally reset all of my Linux servers & VPS every 3 days to lower the load. It's amazing how much it helps. With the amount of RAM you have, your actually doing pretty well if your always getting traffic. Sometimes just restarting the server every night at midnight does a world of good and no one notices the 2 minutes of downtime.
As per the above posters... They are correct, there is a memory leak issue in one of your scripts. The most common place I typically find memory leaks are in poorly coded wordpress modules. If you're running any wordpress sites try fiddling with the plugins (disable/enable) until you can replicate the issue and discover which module is the culprit. There is a cache module floating around that everyone seems to use which ive found is notorious for memory leaks. How many sites are you hosting? It's a pain to hunt down this sort of issue. If you run the following command on a crontab timer it should correct the memory usage without needing to reboot the server or cause any downtime. /usr/sbin/apachectl graceful if it says 'command not found' then try apachectl graceful if it still says command not found, search around your system using whereis & locate to find the proper apachectl binary and run it with graceful as an option.
Host Storm, I never thought of that. But seriously, I don't see a solution in reseting a server daily to fix this. After all, it's a server with linux, not a windows desktop. Thanks to everyone for their suggestions. Recently there was a hardware upgrade that affected my vps and since then the memory load has been at a constant 50%. It appears my problem was solved.
Well thats good news, glad that it fixed its self. On the bright side my advice might help someone else.