Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2006
    Location
    College Station, TX
    Posts
    185

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

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Athens, Greece
    Posts
    1,481
    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.

  3. #3
    Join Date
    Feb 2004
    Posts
    491
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •