2.0.6 & PHP

#1
Hopefully you can help me with this problem. Our production server (E4500 running Solaris 8) for some intranet apps have been running an old pre-2.x lsws setup. The last few days it has been giving 503 pages constantly, and nothing short of a restart would fix it. I finally upgraded it to 2.0.6 to try and help. Now it's not 503'ing, but just about 24 hours (not exactly, but close) and PHP-based page just hangs for about 60+ seconds and then errors out. Any non-PHP page works fine. Once this starts happening a "pkill php" seems to fix the problem. I've tried disabling APC, and I've tried switching between my new copy of PHP 4.3.11 and my old 4.3.9. I'm not sure if the problem is PHP itself or lscgid. I can't truss them, however, since they're suid root.

Do you guys have any clue what's going on? My coworker is complaining at me to put Apache back on, but I really don't want to. Is it really a PHP problem?

Thanks again,
-Dustin
 

mistwang

LiteSpeed Staff
#4
Dustin,

lscgid is not used for FastCGI, unless FastCGI is started in suEXEC mode.

I think what experiencing is that all available PHP processes block on MySQL connections or other socket connections, so all of them won't accept any new requests and requests will be timed out.

On Linux I use "strace" along with 'lsof" to check those PHP processes, not sure how to do it on Solaris. Output of "strace" always shows that PHP process was sitting at "read( x, ... )" syscall. usually 'x" is the file descriptor of the MySQL client connection. So, you may want to check what those PHP processes were doing when that happens.

We are trying to find a proper way to detect those problems and restart PHP automatically. There are some PHP and MySQL configurations to soften the problem. On PHP side, turn off MySQL persistent connection, On MySQL side, set the following in the my.cnf

Code:
interactive_timeout=30
wait_timeout=30
Please let me know it helps or not. :)

George
 
#5
mistwang said:
Dustin,

lscgid is not used for FastCGI, unless FastCGI is started in suEXEC mode.

I think what experiencing is that all available PHP processes block on MySQL connections or other socket connections, so all of them won't accept any new requests and requests will be timed out.

On Linux I use "strace" along with 'lsof" to check those PHP processes, not sure how to do it on Solaris. Output of "strace" always shows that PHP process was sitting at "read( x, ... )" syscall. usually 'x" is the file descriptor of the MySQL client connection. So, you may want to check what those PHP processes were doing when that happens.

We are trying to find a proper way to detect those problems and restart PHP automatically. There are some PHP and MySQL configurations to soften the problem. On PHP side, turn off MySQL persistent connection, On MySQL side, set the following in the my.cnf

Code:
interactive_timeout=30
wait_timeout=30
Please let me know it helps or not. :)

George
I feel stupid then, I guess I figured that since php was in fcgi-bin that lscgid was used :).

I was indeed starting to think it was a PHP problem, since as a stop-gap I put in a cron to restart PHP every 5 minutes, and since then our monitoring app hasn't paged me (finally!). I was just worried that maybe it was lsws's connection to PHP that was hanging.

I actually thought that I got rid of the mysql_pconnect()'s a long time ago, but I guess I only did that in dev and not prod.. DOHT!

I made all of the changes. Hopefully it works better. I'll let you know.

Thanks again. I have to say you guys rock. Even though I'm not a paying customer, you've still helped with every problem I've had. You can be assured that if I can ever justify paying for a web server, you guys will be the first choice!

-Dustin
 
Top