LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Bug Reports > PHP processes constantly climbing

Reply
 
Thread Tools Display Modes
  #1  
Old 11-07-2005, 01:56 AM
matt matt is offline
Member
 
Join Date: Oct 2005
Location: San Francisco
Posts: 37
Default PHP processes constantly climbing

Not sure if this is a bug or a config error on my part, but I've been noticing that the number of lsphp processes climbs steadily and never goes down.

I ran into this when we were getting complaints about mail() not working, so I logged in and noticed that PHP was unable to talk to sendmail because there were thousands of lsphp processes running and monopolizing resources somehow.

Restarting lsws doesn't change anything. The only way I fixed it was running killall -9 lsphp and then restarting lsws. If I run a `ps aux | grep -c lsphp` then it'll show a reasonable value between 5-20, but then starts climbing again endlessly as time goes on.

Any suggestions?
Reply With Quote
  #2  
Old 11-07-2005, 10:12 AM
xing xing is offline
LiteSpeed Staff
 
Join Date: Oct 2003
Location: Los Angeles, California
Posts: 380
Two steps to isolate the problem.

1) Check php.err or stderr.log to see what type of errors php is throwing.

2) Php like to hang on network sockets. Check to make sure if you are using php to scoket to another server, that server is not overloaded or dead.

3) Check lsws error.log to see if it's auto restarting the php pool because of 503 errors. If phps die, lsws will respawn new ones which could lead to hundreds of dead phps if those php don't die correctly.

Php don't usually hang/zombify withouth throwing a bunch of errors in the logs. Check those first.
Reply With Quote
  #3  
Old 11-09-2005, 07:46 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Greetings from caribbean on world second largest ship. :-)
I am on vacation now, can't answer all questions.
Please make sure you are using the latest LSAPI, earlier version may have this kind of problem.
Don't set "Max connections" too high, "Initial request timeout" and connection timeout should be set properly.

For the hanging PHP process, you can try "strace -p <PHP_PID>" to find out on which system call it blocked.

If those do not fix the problem, please write a simple script to monitor the number of PHP processes in a corn job, and kill them when need.

I will investigate the problem when get back on 14th. :-)
Reply With Quote
  #4  
Old 11-14-2005, 12:25 AM
matt matt is offline
Member
 
Join Date: Oct 2005
Location: San Francisco
Posts: 37
I just upgraded to 2.1.5-ent, so we'll see if the problem continues, I'll keep you updated.
Reply With Quote
  #5  
Old 11-14-2005, 01:22 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
If you are using our prebuilt PHP binary, please overwrite lsws/fcgi-bin/lsphp with lsws/admin/fcgi-bin/admin_php to make sure the latest LSAPI code has been used.
Reply With Quote
  #6  
Old 11-14-2005, 04:17 PM
matt matt is offline
Member
 
Join Date: Oct 2005
Location: San Francisco
Posts: 37
Yep, it's back up to 170 processes and rising.

Can I just copy admin_php to lsphp to overwrite it? To upgrade I just used the built-in automatic upgrade thingy.
Reply With Quote
  #7  
Old 11-14-2005, 04:34 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Quote:
Can I just copy admin_php to lsphp to overwrite it? To upgrade I just used the built-in automatic upgrade thingy.
You cannot overwrite binary of a running process, will get "text file busy" error, have to do "rm lsws/fcgi-bin/lsphp" then "cp lsws/admin/fcgi-bin/admin_php lsws/fcgi-bin/lsphp", then restart lsws.
The automatic upgrade does not upgrade lsws/fcgi-bin/lsphp, as it is not a good idea to overwrite a user customized php binary and break things. :-)
Reply With Quote
  #8  
Old 11-18-2005, 04:55 AM
matt matt is offline
Member
 
Join Date: Oct 2005
Location: San Francisco
Posts: 37
I did that and the problem is continuing. We set up a cron script to kill the processes and restart lsws when it gets above 150 and it seems to be kicking off every 14-24 hours.
Reply With Quote
  #9  
Old 11-20-2005, 11:17 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Hi Matt,

Can you please tell me your configuration for lsphp, we will try to reproduce it.

And if possible, please do "strace -p <pid_of_a hanging_php>", post your result, it will help identify the problem as well.

Thanks,
George
Reply With Quote
  #10  
Old 11-22-2005, 11:54 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
This issue should be fixed in the 2.1.6 release.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
replacing system php felosi PHP 3 07-16-2007 11:23 PM
Usability issue with LSAPI PHP jrmarino PHP 5 05-08-2007 01:54 PM
setup php in rails template cswilliams Install/Configuration 2 01-25-2007 08:21 AM
Best configuration for PHP LiteSpeed SAPI jeff Install/Configuration 6 10-19-2005 09:54 AM
Custom PHP integration RikitZap Install/Configuration 2 04-25-2005 06:52 PM


All times are GMT -7. The time now is 01:30 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.