Results 1 to 5 of 5
  1. #1

    Apache randomly using too much RAM

    I'm having a problem with Apache using too much RAM.

    running a single vBulletin forum on the below server (~300 users average). but for some reason, after a random amount of time (sometimes 60 secs, sometimes much as 12hrs) Apache starts eating the RAM. normally the server runs with about 50% free. but once it starts eating ram, it keeps using it till it's using 100% RAM and close to 1.5gb of SWAP (takes about 3 mins to go from 50% free RAM to using 1.5gb swap). for some reason all the Apache forks just start eating more and more. once i simply stop and restart apache it's fine again until the next 60 secs - 12hrs time it happens

    I tried sticking Apache 1.3 (default settings) to see if that fixed the problem, didn't help. still happened. I'm pretty sure it's related to PHP, but unsure what else to try. I've gone through apache's logs, dmesg, everything I can think of and I can't find a cause.

    wondering if anyone else ran into this, or had suggestions to try.

    server ------------------
    dual opteron 242 - 64bit
    1gb ram
    3gb swap
    2.6.8-11-amd64-generic kernel
    PHP Version 4.3.10-15
    Apache/2.0.54 (apache2-mpm-prefork)
    mysql 4.0.24 (x86_64)
    Debian Sarge AMD64
    Last edited by ricocheting; 06-26-2005 at 07:04 PM.

  2. #2
    3gb swap; that is rather a lot. An optimisation is maybe what you need.

    Another stick of RAM would benefit as well

  3. #3
    3gb swap is how it's configured, not how much it's always using. when it's running normally, none of that swap is used and not even half of the 1gb ram is being used. only when it's fubar does it get into the swap.

    right now since it's running correctly, the board has 306 people on it and i'm using 7mb swap, and I have 504mb of RAM free.

    the problem is when apache/php/whatever it is goes nuts and tries to use everything available including all the ram and the swap

  4. #4
    Have you tried recompiling PHP/Apache/MySQL?

    Additionally, is this a cPanel server, or just a box for a singular forum with no control panel?

    There is no valid reason as to why your server can't more than cope with the size of that forum, its not excessively large. You may have a memory leak or as I suggested above, have broken or bad apache/php/SQL configs that cause the load to shoot up.

    Try typing the command "top" whilst logged into SSH, there you should see a list of processes, report back which uses the most memory
    * Rock solid shared & reseller UK webhosting. No downtime™ *
    Now offering fully managed VPS servers

  5. #5
    just a box for a singular forum. no cpanel. for php4 and mysql 4.0 I did binary installs of the latest stable packages listed for sarge amd64. I did try redoing apache to v1.3 (as I can config it on a diff port before going "live" thus having very little downtime). if all else fails, may end up recompiling mysql and php from scratch, but didn't want to have to take everything down for that long if i could help it.

    originally thought it might be a memory leak, but why is it sometimes fine for long periods of time, then all of a sudden start eating everything in a short period. i thought leaks usually gradually got worse over long periods of time

    as for "top" the first 5+ are always apache2. with none of them listed as taking over 1.5 %MEM

Posting Permissions

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