Getting a Lot of 503 Errors

robfrew

Well-Known Member
#1
Back in December, we upgraded to a bigger server with 8 cores. We are using the 64 bit versions of all linux type software. We've adjusted our settings and everything looks fine. We have low loads with high traffic and the site runs fast.

However, every few days, the entire site will get 503 errors and automatically fix itself. There is a period of about 4 - 5 minutes where the site is down while it restarts the lsphp processes. We have created an external app for our lsphp processes. What could be causing this? Here is our configuration for the external app:

Max Connections: 80
Environment: PHP_LSAPI_MAX_REQUESTS=700 PHP_LSAPI_CHILDREN=80
Initial Request Timeout (secs): 60
Retry Timeout (secs): 0
Persistent Connection: Yes
Connection Keepalive Timeout: 20
Response Buffering: No
Auto Start: Yes
Command: $SERVER_ROOT/fcgi-bin/lsphp
Back Log: 100
Instances: 1
Run On Start Up: Yes
Max Idle Time: Not Set
Priority: 0
Memory Soft Limit (bytes): 300M
Memory Hard Limit (bytes): 350M
Process Soft Limit: 2600
Process Hard Limit: 2600

Here is our server config:

Max Connections: 200
Max SSL Connections: 200
Connection Timeout (secs): 60
Max Keep-Alive Requests: 200
Smart Keep-Alive: Yes
Keep-Alive Timeout (secs): 20
Send Buffer Size (bytes): 65535
Receive Buffer Size (bytes): 65535
I/O Event Dispatcher: best (All platforms)
Max Cached Small File Size (bytes):4096
Total Small File Cache Size (bytes): 20M
Max MMAP File Size (bytes): 256K
Total MMAP Cache Size (bytes): 40M
Use sendfile(): Yes
No I-Node in ETag: Not Set
SSL Hardware Accelerator: (built-in) OpenSSL internal engine

Any ideas??
 

robfrew

Well-Known Member
#3
Thanks. We read on XCache site that you need to recompile XCache everytime you update to the latest version of PHP. We did update to the latest PHP last month and didn't up date XCache so we did that today as well as update Zend Optimizer. So far, so good. We will keep an eye on this and let everyone know the outcome.

This is good information to know. So for everyone else out there, if you use any external opcode caches with PHP such as XCache, update them when you update PHP.
 

robfrew

Well-Known Member
#5
Also, we have found that persistent connections from php to mysql can cause a lot of 503 errors and connection timeouts. It is recommended for most site to not use persistent connections within php. We created a wiki for this information for others who may be experiencing this problem: http://www.litespeedtech.com/suppor...tespeed_wiki:php_mysql_persistent_connections

You can also read about our personal experience with this issue here: http://www.litespeedtech.com/support/forum/showthread.php?t=2617
 
Top