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.

Bug in Zend and FD_SETSIZE

Discussion in 'General Discussion' started by dysk, May 15, 2003.

  1. dysk

    dysk Well-Known Member

    Joined:
    Apr 22, 2003
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    Howdy all,
    After a lot of head banging I have found an explanation for a lot
    of the FD_SETSIZE problems.
    It turns out that whenever apache recieves an HUP signal, the Zend has a
    bug that causes it to create another open socket (using a file descriptor).
    This, in conjunction with cPanel, that has a script which sends apache
    an HUP once every 10 minutes causes the apache server to run out of descriptors periodically. When
    you do the math, assuming that you host 50 domains, apache will crash once every 6 days. The more domains you have, the more often it will crash. ((1024-(domains*3))/60/24)
    Obviously the whole easyapache thing has been explored, and I'm not going to go
    into the details about how to recompile apache, however on account of this bug, apache
    will still crash, just less often. If you have 150 domains, apache will crash once every 110 day,
    obviously still a problem, but not really serious.
    There are two workarounds to this problem. One is to disable zend. You do this by going to
    /usr/local/Zend/etc/php.ini and commenting out the two Zend related lines.
    The other is to write a cron script that restarts apache every 3 days or so. When you do this you actually
    have to do /usr/local/apache/bin/apachectl stop; /usr/local/apache/bin/apachectl start This is because apachectl
    doesn't actually stop apache when you tell it to restart, it merely sends it a HUP :)
    I hope that you all find this information useful.


    Best Regards,
    Erek Dyskant
    Unix Consultant

    P.S. I have contacted Zend about this problem and they acknoweleged that it was their problem. They told me that the next version of the Zend optimizer will fix this bug.
     
    #1 dysk, May 15, 2003
    Last edited: May 15, 2003
  2. bjarne

    bjarne Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    Don't get it, the cpanel chkservd only do a graful when the server is not responding - or?

    Also I had this problem on servers with no zend.

    Funny I noticed that when you have this problem, apache stops works - dont's show up in ps and don't realy respond good on graceful restart, so if cpanel scripts does graceful with new account I think they shuld change to stop/start and anyway if not it would be good to have a cron script doing it once ot twice each day of peak - that's what I think.

    But easyapche is from sorcecode, so would it be better to download and compile apache from apache org - I was thinking it would be the same...

    Don't understand how this is relatet to WHM/cpanel realy. Sounds a litle bit like growing pain with loaded long running apache server?
     
  3. dysk

    dysk Well-Known Member

    Joined:
    Apr 22, 2003
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    Howdy,
    I'll try to address those points as they come up:

    cpanellogd sends the server an HUP every ten minutes, see http://faq.cpanel.net/show.cgi?qa=104939834207994

    FD_SETSIZE also runs out on servers with no Zend that have over about 300 domains.

    I think it is of interest to cPanel users because cPanel HUPs the server every 10 minutes. On non-cPanel servers, apache would run a very long time before the number of open sockets becomes noticable. Even a loaded server should be able to run more than 6 days without a crash.

    Regards,
    Erek Dyskant
     
  4. bjarne

    bjarne Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    Thanks! It does explain a lot. But still a cron job with a apacectl stop start will reset the server and basicly remove this problem then.

    This was realy useful info - thanks a lot!
     
  5. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    anyone seen this cause a box to completely lock up??

    cPanel.net Support Ticket Number:
     
  6. Admin356

    Admin356 Active Member

    Joined:
    Feb 19, 2003
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    At the moment, often that happens. No load, no excess memory usage - Found usually 1 httpd process left that will not allow for an apache stop/start/restart - Have to kill that process and restart apache after - thats if the box lets us in to carry that out that is, sometimes the boxes just have to be rebooted to get into them. Grsecurity patched kernels show the story of what is happening with apache, logs full of overstepping errors by httpd - Errors that were not there with the previous builds of apache, the last build sent log entries and problems through the roof - same compiles, same options.

    Frustrating indeed.

    cPanel.net Support Ticket Number:
     
  7. bjarne

    bjarne Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    FInal soultion

    Hi!

    The soultion to this problem as outlined in other useful posts on this forum is to add a cron job to the system:

    apacectl stop
    apachectl start

    Maybe at like 0500 local time in the morning.

    THis shuld make you sleep good at night.:)

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page