Portal Home > Knowledgebase > Articles Database > High Load on Apache/PHP Server - What can I twiddle?


High Load on Apache/PHP Server - What can I twiddle?




Posted by karlkatzke, 09-02-2007, 01:49 AM
In my day job, I deal with a server that gets positivey slammed once a week for a few months per year. I'd tell you how many hits we got tonight, but I'm still waiting for AWSTATS to chew through the 2gb access_log file... Tonight, I made some changes that SEEM to work, but I"mn not sure what the long-term effects could be. If we have any apache experts on the forums, I'd really like to bend your ear for a few to see what you know. Obviously, with PHP, we're limited to prefork MPM. First of all, I dropped Timeout from 300 to 120. That should be MORE than enough time to know that we've timed out. Then I dropped KeepAliveTimeout to 5 from 15. Here's the radical one. Watching the process list and the load, it seemed that load spiked when the processes hit their end of useful life and respawned. Duh. This was happening every four seconds at the load we were under. MaxRequestsPerChild was set to 10,000. I upped this to 80,000 over a period of hours that we were under the load. I didn't see any significant memory leakage, but it's the change I'm worried about the most. I've seen Apache do some bad things when people allow this to go unlimited, and had always used the relatively low default as a guide. Besides not loading a bunch of dynamic modules (also done, I usually do this so I'm not worried about it), what else can I do tuning-wise to keep load down? Please note that caching and load-balancing aren't acceptable solutions; I have one server to work with (for now) and the boss says no to caching because of how frequently our information updates. We also have extensive .htaccess files, so there's no LHTTPD in my future.

Posted by Steve_Arm, 09-02-2007, 05:47 AM
No to caching because of how frequently our information updates? OK, I understand that your boss is not a programmer, but a good caching engine would not give any problems with newly added content. Maybe you need to tune MySQL too. Or the database might need a redesing, I don't know.

Posted by aww, 09-02-2007, 09:29 AM
If you are already using mysql cache and opcode cache (ie. eaccelerator) then try replacing apache with LiteSpeed which will obey your .htaccess files and will radially reduce the server load. It's also faster than Lighttpd.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
HostGator.com Offline (Views: 657)
Hostdime down? (Views: 701)
Secure managed hosting (Views: 644)

Language: