I was running Apache 2 in a Centos 4.3. Recently I upgraded from PHP 4 to PHP 5 because a script needed PHP 5.
Always when I did a free I had at least 500MB free and the apache process had 15M.
Now all the process start at 20M and then grow to 30M and the free memory goes down to 0 in ten minutes after starting apache.
I've limited in php.ini to 10M the memory that a script can take. But in the previous configuration was at 30M with no problems.
My forum users also reports that the forusm are considerably slower.
There is no memory problem here; even when you're down to 16MB free RAM, about half of your memory is allocated to "buffers". That means that the kernel is caching files into memory to make them load faster, but if another program needs that memory, it will be freed for that program.
In fact this is the way Linux is supposed to operate; a Linux system that has been running for a while without restarting any services will have virtually no "free" memory. That is a good thing though -- what good is memory that's not being used? You can see this more clearly with "free -m". The line that reads "-/+ buffers/cache" shows how much used and free memory you have without taking those buffers into account, and it will show you that you still have *plenty* left.
As to why your forums are loading more slowly, that's difficult to say, because there are so many factors that could affect it. For starters, how did you compile PHP5?
Last I checked, the PHP in the CentOS Plus repo were 5.0.x. You should try out 5.1.6 before reverting back to PHP 4.
Anytime I need a newer package than what CentOS offers I try the latest Fedora Development SRPM and recompile it on a second CentOS box. All you should need to do in most cases is an "rpmbuild --rebuild package.src.rpm".
Take a look at the "apachectl status" command , or set up a URL with:
Deny from all
Allow from your.ip.add.ress
If it turns out most of your apache processes are idle most of the time, then you can simply reduce the MaxServer settings in your Apache config.
You can also reduce the KeepAliveTimeout so that the processes aren't tied up as long. Worst case, that would slow things down a tiny bit (because browsers would have to reconnect more often), but that's nothing compared to the slowdown when you run out of memory and the system has to swap to disk.
<<Signature to be setup in your profile>>
Last edited by anon-e-mouse; 10-25-2006 at 10:02 PM.
As mentioned, there is no memory issue here based on what I can see with the screenshots. ~500MB of your memory got allocated for buffers which are freed when your application needs it. Basically, you can say you have 500MB free memory for your applications. The reason your forums are running slow can depend on many factors, but I doubt it is memory related.