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

Go Back   LiteSpeed Support Forums > External Applications > PHP > Are you Getting 503 errors? Connection Timeouts?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-11-2009, 10:38 AM
robfrew robfrew is offline
Senior Member
 
Join Date: Dec 2007
Location: Salt Lake City UT
Posts: 151
Default Are you Getting 503 errors? Connection Timeouts?

We have recently discovered the reason behind why we were getting a load of 503 errors, connection timeouts and so on with our external PHP (lsapi) processes. We hope we can help others who may be experiencing this problem as well.

Our average load times were around 2.5 to 3.0 on an 8 core system. We also have 6 gigs of memory. We get a lot of usage because we are a high traffic site. Everything seemed normal but every day around 9 or 10 am, the external processes would runaway and we would get nothing but 503 errors and connection timeouts. Eventually, LSWS would sever those external processes and restart them but there would be around 5 minutes that nobody could connect with us.

We started playing around with different settings and eventually changed PHP_LSAPI_MAX_REQUESTS to 500 just to see if those external processes would die quicker to avoid the problems. What we found is that the problems we saw every 24 hours started happening a lot quicker. So we upped the PHP_LSAPI_MAX_REQUESTS to 10000 and we found that the problems started happening later, every 48 hours. Well, we did some more research and started reading about persistent connections from PHP to MySql. What we read was that for most sites, this was a bad practice. We began to wonder if this was what was causing the external php processes to hang so we changed our php code to stop using persistent connections and guess what, it fixed our 503 error issues and actually reduced our load averages to .50. It also released a heck of a lot of memory.

So it is recommended in the PHP/MySql community to NOT use persistent connections for most sites.

We have created a WIKI for this tip on the LiteSpeed website. Here is the link: http://www.litespeedtech.com/support...nt_connections

Here is the PHP page for more information on persistent connections: http://us2.php.net/mysql_pconnect
Reply With Quote
  #2  
Old 01-11-2009, 11:45 AM
anewday anewday is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 729
Thanks for the tip! George doesn't recommend turning it on either.
Reply With Quote
  #3  
Old 01-11-2009, 09:36 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Thank you for the wiki and sharing this with us.
Reply With Quote
  #4  
Old 02-03-2009, 10:04 AM
darenas darenas is offline
New Member
 
Join Date: Dec 2008
Posts: 1
Unhappy Connection Timeout

Hi,

I've the same error... :

connection to [uds://tmp/lshttpd/lsphp5.sock] on request #0, Connection timed out!
ExtConn timed out while processing.
connection to [uds://tmp/lshttpd/lsphp5.sock] on request #0, Connection timed out!
ExtConn timed out while processing.
connection to [uds://tmp/lshttpd/lsphp5.sock] on request #0, Connection timed out!
ExtConn timed out while processing.
connection to [uds://tmp/lshttpd/lsphp5.sock] on request #0, Connection timed out!
ExtConn timed out while processing.
connection to [uds://tmp/lshttpd/lsphp5.sock] on request #0, Connection timed out!
ExtConn timed out while processing.
connection to [uds://tmp/lshttpd/lsphp5.sock] on request #0, Connection timed out!
ExtConn timed out while processing.
connection to [uds://tmp/lshttpd/lsphp5.sock] on request #0, Connection timed out!
Connection idle time: 11 while in state: 5 watching for event: 25,close!
Content len: 0, Request line:


But i don't use the persistents connections... Have you got any idea?

Thanks.
Reply With Quote
  #5  
Old 02-03-2009, 06:34 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Please follow tips in

http://www.litespeedtech.com/support...ouble_shooting
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


All times are GMT -7. The time now is 04:00 AM.



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