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.

Httpd dies, WHM cannot restart

Discussion in 'General Discussion' started by porcupine, Aug 23, 2003.

  1. porcupine

    porcupine Well-Known Member
    PartnerNOC

    Joined:
    Apr 18, 2002
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Toronto, Ontario
    cPanel Access Level:
    DataCenter Provider
    Ok this is pretty simple. Httpd dies, it leaves hung processes running, and cannot seem to be restarted automagically using chkserv. Exerpt from the /usr/local/apache/logs/error_log is the same near every time. This happens across multiple servers, yet does not give *any* clear clue as to why httpd has attempted to restart in the first place:


    [Sat Aug 23 09:20:18 2003] [error] [client 143.107.38.77] File does not exist: /home/vaeleno/public_html/404.shtml
    [Sat Aug 23 09:20:39 2003] [notice] SIGUSR1 received. Doing graceful restart
    [Sat Aug 23 09:20:39 2003] [error] Cannot remove module mod_attach.c: not found in module list
    httpd: module "mod_auth_passthrough.c" could not be loaded, because the dynamic
    module limit was reached. Please increase DYNAMIC_MODULE_LIMIT and recompile.


    When looking to see why httpd wont restart we see:


    root@www4 [/usr/local/apache/logs]# ps auxww | grep httpd
    nobody 26830 0.0 0.2 20496 2304 ? S Aug22 0:12 [httpd]
    nobody 21002 0.0 0.2 22524 2576 ? S Aug22 0:17 [httpd]
    nobody 7388 0.0 0.2 22968 2452 ? S 00:35 0:12 [httpd]
    nobody 9099 0.0 0.2 25504 2800 ? S 00:56 0:28 [httpd]
    nobody 9100 0.1 0.2 25544 2636 ? S 00:56 0:32 [httpd]
    nobody 2336 0.4 0.2 24704 2756 ? S 05:22 1:02 [httpd]
    nobody 4122 0.0 0.3 25420 3448 ? S 05:49 0:05 [httpd]
    nobody 15577 0.2 1.3 26096 13560 ? S 08:25 0:09 [httpd]
    nobody 15697 0.4 1.0 24060 11208 ? S 08:27 0:15 [httpd]
    nobody 17957 0.3 0.9 23660 9968 ? S 08:55 0:07 [httpd]
    nobody 18135 0.2 1.5 24232 15736 ? S 08:57 0:05 [httpd]
    nobody 19091 0.2 1.4 23196 14448 ? S 09:08 0:02 [httpd]
    root 20262 0.0 0.0 1704 620 pts/0 S 09:26 0:00 grep httpd


    From this point, a "killall -9 httpd; killall -9 httpd; /usr/local/apache/bin/apachectl startssl" is necessary to kickstart stuff back into action. Chkserv doesen't seem to be able to handle this problem. The note about the dynamic module limit only seems to appear when chkserv is attempting to restart httpd, and does not persist when manually killall -9'ing httpd and restarting by hand.

    Most importantly on this topic, *I* like to sleep between 2-10am, regardless of what CPanel prefers to do! I want my sleep back :mad:
     
  2. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    What OS are you running? Is Apache fairly busy request wise at all times or specifically during the overnight hours? What do you have for min, max, start servers? Is keepalive on? What is the keepalive & normal timeout set to? What is MaxRequestsPerChild set to? Are you limiting the amount of mem/cpu/proc a user can use?

    cPanel.net Support Ticket Number:
     
  3. porcupine

    porcupine Well-Known Member
    PartnerNOC

    Joined:
    Apr 18, 2002
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Toronto, Ontario
    cPanel Access Level:
    DataCenter Provider
    Misc versions of redhat, from 7.2 to 8.1. This is intermittent, fairly random, not at any particular time of day. The keepalive, timeout, maxrequestsperchild, etc. are all set to cPanel defaults, none of which have been tweaked.

    The amount of mem/cpu/proc a user can use in HTTPD is not whatsoever limited.

    cPanel.net Support Ticket Number:
     
  4. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    Ouch, defaults are bad. That's like driving from Montreal to Toronto (6 hours) in a brand new car without adjusting the seat, mirrors, etc. It's okay to start, but after an hour or so you need a break and eventually you want to stop for the night because you don't want to drive anymore that day.

    Here are some decently tweaked settings for a high end P3, mid-range P4 with 1 - 2 GBs of RAM:
    Code:
    #
    # Timeout: The number of seconds before receives and sends time out.
    # 
    Timeout 12
    
    # 
    # KeepAlive: Whether or not to allow persistent connections (more than
    # one request per connection). Set to "Off" to deactivate.
    #
    KeepAlive On
    
    # 
    # MaxKeepAliveRequests: The maximum number of requests to allow
    # during a persistent connection. Set to 0 to allow an unlimited amount.  
    # We recommend you leave this number high, for maximum performance.
    # 
    MaxKeepAliveRequests 0
      
    #
    # KeepAliveTimeout: Number of seconds to wait for the next request from the
    # same client on the same connection.
    # 
    KeepAliveTimeout 8
     
    #
    # Server-pool size regulation.  Rather than making you guess how many
    # server processes you need, Apache dynamically adapts to the load it
    # sees --- that is, it tries to maintain enough server processes to     
    # handle the current load, plus a few spare servers to handle transient
    # load spikes (e.g., multiple simultaneous requests from a single
    # Netscape browser).
    #
    # It does this by periodically checking how many servers are waiting
    # for a request.  If there are fewer than MinSpareServers, it creates
    # a new spare.  If there are more than MaxSpareServers, some of the
    # spares die off.  The default values are probably OK for most sites.
    # 
    MinSpareServers 8
    MaxSpareServers 20
    
    # 
    # Number of servers to start initially --- should be a reasonable ballpark
    # figure.
    #       
    StartServers 8
    
    # 
    # Limit on total number of servers running, i.e., limit on the number
    # of clients who can simultaneously connect --- if this limit is ever
    # reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
    # It is intended mainly as a brake to keep a runaway server from taking
    # the system with it as it spirals down...
    # 
    MaxClients 850
    
    #
    # MaxRequestsPerChild: the number of requests each child process is
    # allowed to process before the child dies.  The child will exit so
    # as to avoid problems after prolonged use when Apache (and maybe the
    # libraries it uses) leak memory or other resources.  On most systems, this
    # isn't really needed, but a few (such as Solaris) do have notable leaks
    # in the libraries. For these platforms, set to something like 10000
    # or so; a setting of 0 means unlimited.
    # 
    # NOTE: This value does not include keepalive requests after the initial
    #       request per connection. For example, if a child process handles
    #       an initial request and 10 subsequent "keptalive" requests, it
    #       would only count as 1 request towards this limit.
    # 
    MaxRequestsPerChild 10000
    Then anywhere near the top of the conf file, slam the following in to limit CPU/mem usage
    Code:
    RLimitMEM 103288149
    RLimitCPU 240
    Restart Apache and hope for the best. In most cases these are good numbers for a busy Apache/PHP/MySQL driven server. The numbers work well for me on a server that pounds out over 10 M hits a month using PHP/MySQL.

    cPanel.net Support Ticket Number:
     
  5. porcupine

    porcupine Well-Known Member
    PartnerNOC

    Joined:
    Apr 18, 2002
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Toronto, Ontario
    cPanel Access Level:
    DataCenter Provider
    It's not really a performance issue i'm at problems with here, it's the httpd dying, sitting idle, and not being able to restart that I'm looking to repair :).

    cPanel.net Support Ticket Number:
     
  6. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    I realize that. But the default settings are going to have each connection to the server hanging around for 300 seconds...5 minutes...for no reason. Along with other ill things due to an erroneous default config file. Killing connections off early (within 12 seconds and not 5 minutes--12 seconds is extremely generous) and having decent settings will more than likely correct the issue of Apache failing.

    cPanel.net Support Ticket Number:
     
  7. porcupine

    porcupine Well-Known Member
    PartnerNOC

    Joined:
    Apr 18, 2002
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Toronto, Ontario
    cPanel Access Level:
    DataCenter Provider
    Ahh ok i was mistaken:

    # KeepAliveTimeout: Number of seconds to wait for the next request from the
    KeepAliveTimeout 10


    Keepalive had been set previously after a synflood i believe :).

    cPanel.net Support Ticket Number:
     
  8. WMS

    WMS Active Member

    Joined:
    Jul 18, 2003
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Moscow
    mod_attach

    Had the SAME problem.
    Did you see "Cannot remove module mod_attach.c: not found in module list"?

    Find the line
    #AddModule mod_attach.c

    Uncomment that.
    (remove #)


    And you WILL sleep well.:)

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page