Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 17
  1. #1
    Member
    Join Date
    Apr 2004
    Posts
    320

    Angry PHP processes being stalled a few times a day

    Hi,

    I've got three dual opteron servers, which are all experiencing the same problem. All three servers are running CentOS 4.3 x86_64 with the latest *stable* release of cPanel/WHM. PHP/Apache has been compiled with :

    * GD support
    * IMAP support
    * PHPsuexec support
    * Zend Optimizer

    A few times a day the PHP module just stops responding (noticeble by PHP processes being stalled). During that time normal html pages are displayed without problems, thus the assumption that it has something to do with the PHP module. The "lock" always lasts for a few seconds and then everything is being served as usual. During such time there's no heavy load at all. What I also noticed is that you're unable to log onto the server via SSH during the "lock". User_id and password are being accepted, but the information is not being processed during the "lock".

    I've already created a ticket for it @ cPanel, but after three weeks of testing, cPanel claims it's a problem with the hardware and not related to cPanel not functioning correctly... All three servers are different brands and are almost brand-new, so I doubt that's the case here...

    Does anyone have similar problems? And most important... was able to solve it?

    Thanking you in advance.

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Odd. Could be a resource leak or even running out of MySQL connections. Things to try:

    In httpd.conf set:

    KeepAlives 3
    MaxRequestsPerChild 50

    Then restart httpd. The latter helps with resource leaks.

    In /usr/lib/php.ini:

    mysql.allow_persistent = Off

    Then restart httpd.

    In /etc/my.cnf

    set-variable = max_connections=750

    Then restart MySQL. This shouldn't really be necessary with the httpd.conf and php.ini changes, though.

    Final thought, make sure /tmp isn't nearly full incase the problem is with creating session files within it.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Member
    Join Date
    Apr 2004
    Posts
    320

    Default

    Hi Chirpy,

    Thanks for trying to help me out...

    Quote Originally Posted by chirpy
    Odd. Could be a resource leak or even running out of MySQL connections. Things to try:

    In httpd.conf set:

    KeepAlives 3
    MaxRequestsPerChild 50

    Then restart httpd. The latter helps with resource leaks.
    The following is currently set up :

    Code:
    Timeout 50
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 5
    MinSpareServers 20
    MaxSpareServers 35
    StartServers 50
    MaxClients 512
    MaxRequestsPerChild 10000
    I could not find "KeepAlives". Is that a typo?
    The other options you mentioned were already present/altered...

    Thanks.

  4. #4
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Sorry, KeepAlives should be KeepAliveTimeout. As mentioned above, I'd suggest that you set MaxRequestsPerChild down to 50
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  5. #5
    Member
    Join Date
    Apr 2004
    Posts
    320

    Angry

    Hi Chirpy,

    Thanks for the suggestions. Unfortunately they did solve the issue...

    PHP processes are still stalled on this server a few times a day...
    This is also noticable by executing :
    Code:
    root@xxxxx [~]# php -v
    PHP 4.4.2 (cli) (built: Mar 26 2006 06:52:46)
    Copyright (c) 1997-2006 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
        with Zend Extension Manager v1.0.9, Copyright (c) 2003-2006, by Zend Technologies
        with Zend Optimizer v2.6.2, Copyright (c) 1998-2006, by Zend Technologies
    Normally this will show the installed version immediately, but at the time the PHP processes are being stalled, it takes up to a few seconds before that information is displayed.

    Server load does not seem to have anything to do with the PHP processes being stalled; it also happens when server load is @ only 0.38.

    *) Is it possible one client on the server could be the source of this issue (although nothing out of the ordinary is shown)?
    *) Do you have any other suggestions I can try?

    Thanks once again.

  6. #6
    Member
    Join Date
    Apr 2004
    Posts
    320

    Angry

    [Update]
    Last night was the worsed of all cases. All three servers in the same DNS cluster did not respond to any PHP request for quite some time at the same(!) time. Restarting httpd on one of these servers did not solve the problem.

    I really would like some help on this problem, becuase this is really costing me my sleep (and my customers)...

    Thanks to any one who can help...

  7. #7
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,117
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Any chance this is some sort of DNS lookup (or reverse DNS lookup) problem?

  8. #8
    Member
    Join Date
    Apr 2005
    Posts
    318

    Default

    KeepAlive On - turn this off!
    http://www.crohoster.com/
    quality hosting services and managed dedicated servers

  9. #9
    Member
    Join Date
    Apr 2004
    Posts
    320

    Default

    Quote Originally Posted by brianoz
    Any chance this is some sort of DNS lookup (or reverse DNS lookup) problem?
    I don't think so... plain HTML sites are serviced without any problems during the problem...

    Quote Originally Posted by MMarko
    KeepAlive On - turn this off!
    That should only be the case if the problem could be determined to "Server load" levels, but that's certainly not the case here... because PHP scripts were not (able to be) serviced "server load" dropped down to .22 levels at most...

  10. #10
    Member
    Join Date
    Apr 2004
    Posts
    320

    Exclamation

    [Update 2]

    During another stall of PHP scripts on one of the servers I noticed the following in the /etc/httpd/logs/access_log :

    Code:
    killall -TERM httpd;sleep 2;killall -9 httpd;/etc/rc.d/init.d/httpd stop;/etc/rc.d/init.d/httpd startssl;/usr/local/apache/bin/apachectl startssl
    Any idea what this line does and where it comes from (I surely did not execute it)?

    Thanks...

  11. #11
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,117
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Sure you haven't been compromised somehow? Did you give us the entire, exact line in the log? The effect of that line would be to lock out PHP and Apache for a few seconds, definitely!

  12. #12
    Member
    Join Date
    Apr 2004
    Posts
    320

    Default

    Quote Originally Posted by brianoz
    Sure you haven't been compromised somehow?
    Nope, I don't think so... Chkrootkit, Rkhunter, /tmp and /dev/shm do not show anything out of the ordinary...

    Did you give us the entire, exact line in the log?
    This is the full line in the access_log :
    Code:
    127.0.0.1 - - [06/May/2006:15:35:37 +0200] "GET / HTTP/2.0;killall -TERM httpd;sleep 2;killall -9 httpd;/etc/rc.d/init.d/httpd stop;/etc/rc.d/init.d/httpd startssl;/usr/local/apache/bin/apachectl startssl" 400 299
    The effect of that line would be to lock out PHP and Apache for a few seconds, definitely!
    According to the ppl managing the server this command was issued by the chkservd process run by cPanel. It checks whether the httpd service is running or not every ten minutes and restarts it when it is down...

    Regards.

  13. #13
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,117
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Could well be; but if so, chkservd is broken, at least on your system. The killall stuff shouldn't be appearing in the access log! They're shell commands, only meant to be executed in the shell, and only then if httpd is down. Why are they appearing in the log at all?

    I have chkservd running on my server and I don't get lines like that in my access log.

  14. #14
    Member
    Join Date
    Apr 2004
    Posts
    320

    Default

    Quote Originally Posted by brianoz
    Could well be; but if so, chkservd is broken, at least on your system. The killall stuff shouldn't be appearing in the access log! They're shell commands, only meant to be executed in the shell, and only then if httpd is down. Why are they appearing in the log at all?

    I have chkservd running on my server and I don't get lines like that in my access log.
    The commands does not seem to be issued by checkservd.
    The commands in the file /etc/chkserv.d/httpd are not identical to the ones found in the log file...

  15. #15
    Member
    Join Date
    Apr 2004
    Posts
    320

    Default

    [update]

    access_log :
    Code:
    127.0.0.1 - - [06/May/2006:15:35:37 +0200] "GET / HTTP/2.0;killall -TERM httpd;sleep 2;killall -9 httpd;/etc/rc.d/init.d/httpd stop;/etc/rc.d/init.d/httpd startssl;/usr/local/apache/bin/apachectl startssl" 400 299
    /etc/chkserv.d/https :
    Code:
    service[https]=443,GET / HTTP/2.0;killall -TERM httpd;sleep 2;killall -9 httpd;/etc/rc.d/init.d/httpd stop;/etc/rc.d/init.d/httpd startssl;/usr/local/apache/bin/apachectl startssl
    These are identical!! Does this mean https goes "down" that often and is restarted by chkserv.d each time?? I do not receive any messages from SIM or PRM...

    Thanks.

Similar Threads & Tags
Similar threads

  1. Exim restarting several times a day
    By nyjimbo in forum E-mail Discussions
    Replies: 59
    Last Post: 09-10-2007, 02:58 PM
  2. PHP processes being stalled a few times a day[2]
    By Bdzzld in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 05-09-2006, 04:03 AM
  3. crashing twice a day at same times - cron? something else?
    By hostricity in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-26-2006, 05:31 PM
  4. Server crash every day 1-3 times
    By cosmin in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 04-19-2004, 12:30 AM
  5. Apache fails few times a day
    By Bullet in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-21-2001, 08:47 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube