The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Apache 2.2 with Worker or prefork?

Discussion in 'EasyApache' started by tolouei, May 20, 2008.

  1. tolouei

    tolouei Member

    Joined:
    May 17, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    I have a xeon conroe dual core server with 4gb ram running whm/cpanel 11, with apache 2.2.8 and the last php verson, cgi, perl.

    In this server is running a high traffic and processing site, with php + mysql and perl forum (yabb).

    My question is: is better to use apache with Worker or Prefork mpm?

    I read about using worker with php and perl and its not recomended, because is unstable. Is it true?

    Thanks a lot
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The Worker MPM uses threads. Some (many?) PHP extensions are not thread-safe and cannot be used.

    The recommendation when using mod_php is to use the Prefork MPM.

    If you are not using mod_php, for example using mod_suphp, or FastCGI to server PHP content, then Worker should be fine.
     
    #2 cPanelKenneth, May 20, 2008
    Last edited: May 21, 2008
  3. tolouei

    tolouei Member

    Joined:
    May 17, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1

    Hi,

    But, what is the faster/the best solution? In pick usage, I have more than 500 simultan conections...

    Thanks
     
  4. rkm11

    rkm11 Active Member

    Joined:
    May 30, 2007
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    I use Prefork. I think he recommended that above.

    Are you experiencing problems?
     
  5. VeZoZ

    VeZoZ Well-Known Member

    Joined:
    Dec 14, 2002
    Messages:
    248
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    Interesting

    I thought mod_suphp would run fine with worker, however I had several boxes end up with PHP processes that never died out. I thought maybe it was worker causing it but I am not to sure about that one.

    Of course with worker it was super stable when it came to httpd requests that thing never failed on a request. Prefork on the other hand I'd say once a day I got at least one notice from a monitoring service (Run 3 of them all 1 minute monitoring) saying something failed a request.

    I wish I could have figured out what was causing the PHP processes to hang (no cpu just ram). But not much an expert with regards to debugging that sort of stuff.
     
  6. HostIgnition

    HostIgnition Registered

    Joined:
    Oct 19, 2003
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    We noticed the same issue and end up going back to prefork for more stable httpd. However, CPU usage definitely get much higher due to much higher rate of spawning process.

    Definitely worker + mod_suphp will give much faster response for httpd but memory leak and php process hang may cause server to hang due to too much memory consumption over time.
     
  7. VeZoZ

    VeZoZ Well-Known Member

    Joined:
    Dec 14, 2002
    Messages:
    248
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    Well prefork has this issue as well I noticed, however you may only see maybe one show up over the course of a day or two opposed to worker where you leave it 12 hours and you could have 20 php processes just sitting there.
     
Loading...

Share This Page