top shows load average is 25%

Discussion in 'Apache' started by wormy, Jul 19, 2006.

  1. #1
    Whenever I run top now the load average is around 25% in all three columns. But the CPU utilization is around 50% to 90% but never getting stuck above 90% usually. The traffic is 2.5 MBits/s both ways. The server is a P4 2.8 Ghz with 2 gigs of RAM.

    Does this sound pretty bad? My pages seem to load halfway decent but am I teetering on the edge here or is this perfectly normal for a server. I don't really know how many clients are connected but I think I put the cutoff at 130.

    And what can I do to free up some resources? I run php and perl scripts(its a web proxy server).
     
    wormy, Jul 19, 2006 IP
  2. DrMalloc

    DrMalloc Peon

    Messages:
    130
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Using a memory-based cache such as memcached could free up some database load (if you're using mysql/postgre/etc.). Using a bytecode cache for PHP like APC or eaccelerator helps the cpu load and speeds up serving. If you're running php or perl as a CGI, perhaps considering switching to mod_php and mod_perl, or FastCGI.
     
    DrMalloc, Jul 19, 2006 IP
  3. CeciliaH

    CeciliaH Active Member

    Messages:
    223
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #3
    I'd up the connections in httpd.conf - It doesnt hurt to set it to 500 or something - since if you hit your cap it starts to die for any subsequent users.

    Can you define the 25% in actual numbers? ie 0.25? or 2.5?
     
    CeciliaH, Jul 19, 2006 IP
  4. wormy

    wormy Active Member

    Messages:
    1,112
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #4
    I should have not said 25%. Its actually 25 not 25%. There are there are three columns right at the top of top and during peak hours my "load aveage" was 25, 28, 27 or something like that. Since then I have found out this means that 25 is the average number of processes waiting in the queue for the CPU to process them in the last 5 minutes, 28 is the number of processes waiting for the CPU in the last 10 minutes and 27 is the figure for the last 15 minutes. :eek:
     
    wormy, Jul 19, 2006 IP
  5. wormy

    wormy Active Member

    Messages:
    1,112
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #5
    I don't use any mysql. I did install mod_perl to take care of the CGI scripts. No clue if that helped or not since that was done a couple of weeks ago.

    I will look into APC and eaccelerator. This box has a lot of RAM relatively speaking for its CPU power so caching might be a good idea.
     
    wormy, Jul 19, 2006 IP
  6. wormy

    wormy Active Member

    Messages:
    1,112
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #6
    Are you implying that I am reaching my max load of 130 and clients might be getting turned away or put in this "queue" where their process is waiting for the CPU and thus causing the spike in my top load averages?

    See my post above, it was actual numbers. The percentage was added by my in error. It was purely load average which you see in top right at the top.
     
    wormy, Jul 19, 2006 IP