Apache not using all the available resources

Discussion in 'Apache' started by mapcorp, Apr 27, 2009.

  1. #1
    Hi,
    I have a quite loaded webserver, the CPU is very low and memory usage is also low, but sometimes the page doesn't respond...

    Here's the info on my system:

    FreeBSD 7.1 amd64
    1x Q9550 (quad core)
    8Gb RAM

    top
    ------
    last pid: 13453; load averages: 0.09, 0.08, 0.07 up 3+04:04:03 00:34:56
    306 processes: 1 running, 304 sleeping, 1 zombie
    CPU: 0.3% user, 0.0% nice, 0.2% system, 0.0% interrupt, 99.5% idle
    Mem: 666M Active, 1746M Inact, 545M Wired, 84K Cache, 214M Buf, 4957M Free
    Swap: 4096M Total, 4096M Free

    PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
    97616 root 1 44 0 181M 22084K select 0 0:14 0.00% httpd
    516 root 1 44 0 5688K 1376K select 0 0:07 0.00% syslogd
    652 root 1 44 0 10696K 4120K select 0 0:03 0.00% sendmail
    11084 www 1 44 0 183M 25556K select 0 0:02 0.00% httpd
    641 root 1 44 0 22876K 3904K select 3 0:01 0.00% sshd
    11977 www 1 44 0 183M 25432K select 0 0:01 0.00% httpd
    95731 root 1 44 0 33768K 4688K select 0 0:01 0.00% sshd
    12203 www 1 44 0 183M 25344K select 0 0:01 0.00% httpd
    95408 root 1 44 0 33768K 4688K select 0 0:01 0.00% sshd
    12354 www 1 44 0 183M 25884K select 3 0:01 0.00% httpd
    95391 root 1 44 0 33768K 4688K select 1 0:01 0.00% sshd
    12419 www 1 44 0 182M 25104K select 0 0:01 0.00% httpd
    12437 www 1 44 0 182M 25204K select 2 0:01 0.00% httpd
    12468 www 1 44 0 183M 25788K select 0 0:01 0.00% httpd
    12479 www 1 44 0 183M 25208K select 3 0:01 0.00% httpd
    12453 www 1 44 0 183M 25224K select 2 0:01 0.00% httpd
    12478 www 1 44 0 183M 25304K select 0 0:01 0.00% httpd
    12617 www 1 44 0 183M 25284K select 3 0:00 0.00% httpd
    12550 www 1 44 0 183M 25164K select 0 0:00 0.00% httpd
    12529 www 1 44 0 182M 25252K select 0 0:00 0.00% httpd
    12621 www 1 44 0 182M 25308K select 0 0:00 0.00% httpd
    12694 www 1 44 0 182M 25148K select 0 0:00 0.00% httpd
    12680 www 1 44 0 182M 25124K select 2 0:00 0.00% httpd
    12650 www 1 44 0 182M 25060K select 0 0:00 0.00% httpd
    12730 www 1 44 0 183M 25152K select 3 0:00 0.00% httpd
    12698 www 1 44 0 183M 25476K select 0 0:00 0.00% httpd
    12708 www 1 4 0 183M 25536K accept 0 0:00 0.00% httpd
    12665 www 1 44 0 182M 25028K select 3 0:00 0.00% httpd
    12809 www 1 44 0 183M 25312K select 0 0:00 0.00% httpd
    12787 www 1 44 0 182M 25072K select 0 0:00 0.00% httpd
    12798 www 1 44 0 182M 25116K select 0 0:00 0.00% httpd
    12788 www 1 44 0 183M 25440K select 3 0:00 0.00% httpd
    12752 www 1 44 0 182M 25208K select 0 0:00 0.00% httpd
    12852 www 1 44 0 183M 25092K select 2 0:00 0.00% httpd
    12794 www 1 44 0 182M 25172K select 3 0:00 0.00% httpd
    12866 www 1 44 0 183M 25088K select 2 0:00 0.00% httpd
    662 root 1 8 0 6744K 1440K nanslp 0 0:00 0.00% cron
    12760 www 1 44 0 183M 25500K select 0 0:00 0.00% httpd
    12754 www 1 44 0 182M 25216K select 0 0:00 0.00% httpd
    12833 www 1 44 0 182M 25080K select 3 0:00 0.00% httpd
    12907 www 1 44 0 182M 25296K select 3 0:00 0.00% httpd
    12864 www 1 44 0 182M 25072K select 0 0:00 0.00% httpd
    12842 www 1 44 0 182M 25232K select 0 0:00 0.00% httpd
    12816 www 1 44 0 183M 25264K select 0 0:00 0.00% httpd
    12925 www 1 44 0 182M 25008K select 3 0:00 0.00% httpd
    12800 www 1 44 0 182M 25056K select 2 0:00 0.00% httpd
    12948 www 1 44 0 183M 25696K select 0 0:00 0.00% httpd
    12914 www 1 44 0 182M 25208K select 0 0:00 0.00% httpd
    12911 www 1 44 0 182M 24876K select 0 0:00 0.00% httpd
    12904 www 1 44 0 183M 25100K select 0 0:00 0.00% httpd
    12944 www 1 44 0 183M 25180K select 1 0:00 0.00% httpd
    13029 www 1 44 0 182M 25316K select 3 0:00 0.00% httpd
    ......many more httpd processes ....truncated.....

    How can it be to have 5Gb of RAM free? each apache process uses almost 26Mb and there are 300 processes so ....26Mbx300processes= 7800Mb (the system have 8Gb)??


    My hhtpd.conf (relevant lines) as follows:
    Timeout 20
    KeepAlive On
    MaxKeepAliveRequests 0
    KeepAliveTimeout 15
    MinSpareServers 16
    MaxSpareServers 64
    StartServers 16
    ServerLimit 512
    MaxClients 512
    MaxRequestsPerChild 10000



    do you recommend me any changes? why the CPU and memory is not fully used...and why the server is not responding sometimes with so low load?

    Thanks for your help
     
    mapcorp, Apr 27, 2009 IP
  2. SSANZ

    SSANZ Peon

    Messages:
    861
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi

    can do print the result of uname -a

    Make sure your OS is 64bit otherwise its not going to see the full 8gb of RAM.

    Regards,
    Logan
     
    SSANZ, Apr 28, 2009 IP
  3. mapcorp

    mapcorp Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    [root@webmaster /usr/local/etc/apache22]# uname -a
    FreeBSD webmaster.accesorius.com 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan 1 08:58:24 UTC 2009 :/usr/obj/usr/src/sys/GENERIC amd64
     
    mapcorp, Apr 28, 2009 IP