MaxRequestsPerChild

Discussion in 'Apache' started by Noodles25, Apr 19, 2007.

  1. #1
    We run a high traffic PHP site. At the moment we're finding that one of the web servers (4 load balanced servers) is running out of memory at least once a day.

    At the moment we have MaxRequestsPerChild set to 0 so that the children are never restarted, but then each child can start to chew up memory if a memory intensive script is run. When too many children are using too much memory each then the server starts swapping and then it uses all available ram/swap (4GB RAM, 2GB swap).

    What level of MaxRequestsPerChild does everyone else run for their PHP sites?
     
    Noodles25, Apr 19, 2007 IP
  2. Noodles25

    Noodles25 Active Member

    Messages:
    75
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #2
    We're using prefork MPM on apache 2.2.4 btw
     
    Noodles25, Apr 19, 2007 IP
  3. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #3
    I got

    Timeout 50
    KeepAlive On
    MaxKeepAliveRequests 120
    KeepAliveTimeout 10
    StartServers 16
    MinSpareServers 10
    MaxSpareServers 20
    MaxClients 125
    MaxRequestsPerChild 5000
     
    Nintendo, Apr 19, 2007 IP
  4. Noodles25

    Noodles25 Active Member

    Messages:
    75
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #4
    What sort of traffic are you getting on that server?
     
    Noodles25, Apr 19, 2007 IP
  5. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #5
    Most of it's on a vBulletin board. Probably gets less than your server.
    
     19:10:41  up 76 days, 20:49,  1 user,  load average: 2.22, 1.85, 2.43
    125 processes: 119 sleeping, 4 running, 2 zombie, 0 stopped
    CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
               total   88.8%    0.0%   11.1%   0.0%     0.0%    0.0%    0.0%
    Mem:  2047380k av, 1979440k used,   67940k free,       0k shrd,   77708k buff
                       1367104k actv,  270436k in_d,   26800k in_c
    Swap: 2096472k av,    8484k used, 2087988k free                 1191736k cached
    
    Code (markup):
     
    Nintendo, Apr 19, 2007 IP