Getting a Lot of 503 Errors

Discussion in 'General' started by robfrew, Jan 7, 2009.

  1. robfrew

    robfrew Well-Known Member

    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
    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??
  2. mistwang

    mistwang LiteSpeed Staff

  3. robfrew

    robfrew Well-Known Member

    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.
  4. anewday

    anewday Moderator

    Thanks for the information, perhaps it should be added to the wiki. :)
  5. robfrew

    robfrew Well-Known Member

    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:

    You can also read about our personal experience with this issue here:

Share This Page