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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > How to debug 503 Service Unavailable error

Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2012, 09:19 AM
eugene_b eugene_b is offline
New Member
 
Join Date: Apr 2012
Posts: 2
Default How to debug 503 Service Unavailable error

Hello,

We are using dompdf library which is a php library that converts html to pdf. And for some html documents we are trying to convert, server outputs 503 error (the server is cpanel litespeed).

The error is consistent and always happens for a given document. However if I start taking away some stuff from the document, it starts working at some point. I also tried taking away different pieces of the document and it seems that the error is not specific to some piece, but rather to the total size of the document.

That led me to believe that the server is hitting some memory limit. However when I created a test script that overloads the memory and ran it on the same server, the behavior was normal: it was gradually using up the memory and then died with php's memory error when it did hit the right limit. Then I decided to test against script run-time in case it's an infinite loop. The script in question fails with 503 error after 35 seconds of execution. A test script that just waits for 60 seconds, doesn't fail at all.

So I am a little lost and would appreciate some help debugging this. I tried searching through forum and checking multiple log files but didn't find anything useful. Could you let me know how I should approach the problem, i.e. how can I get from the server anything more descriptive than 503. We tried increasing different configs in litespeed admin area but that didn't help too.
Reply With Quote
  #2  
Old 04-05-2012, 06:40 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,338
what's your PHP version? memory_limit (shown in phpinfo page), memory limit (soft/hard) in lsphp5?

paste snippet of the script in question to help us duplicate the issue. also the message around 503 error in the error_log.
Reply With Quote
  #3  
Old 04-06-2012, 01:09 PM
eugene_b eugene_b is offline
New Member
 
Join Date: Apr 2012
Posts: 2
The PHP version is 5.2.8
memory_limit = 200M
memory soft limit = 629145600
memory hard limit = 929145600

Pasting the snippet of code is problematic. It's a huge 3rd party script with many classes and complex logic and I am not sure where exactly it is failing.

After setting error reporting level to the highest value, I've managed to find 503 in the error log, please see the attached file.
Attached Files
File Type: txt log.txt (13.5 KB, 3 views)
Reply With Quote
  #4  
Old 04-06-2012, 06:52 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,338
Quote:
2012-04-06 15:21:56.737 [INFO] [CONNECTION_IP:52234-0#APVH_DOMAIN.GOES.HERE:lsapi] connection to [/tmp/lshttpd/APVH_alohawork.DOMAIN.GOES.HERE_Suphp.sock] on request #0, confirmed, 1, associated process: 5644, running: 0, error: Connection reset by peer!
2012-04-06 15:21:56.738 [DEBUG] [CONNECTION_IP:52234-0#APVH_DOMAIN.GOES.HERE:lsapi] [ExtConn] close()
2012-04-06 15:21:56.738 [DEBUG] [uds://tmp/lshttpd/APVH_alohawork.DOMAIN.GOES.HERE_Suphp.sock] No Request has been processed successfully through this connection, the maximum connections allowed will be reduced!
2012-04-06 15:21:56.738 [DEBUG] [CONNECTION_IP:52234-0#APVH_DOMAIN.GOES.HERE:lsapi] HttpExtConnector::tryRecover()...
2012-04-06 15:21:56.738 [NOTICE] [CONNECTION_IP:52234-0#APVH_DOMAIN.GOES.HERE:lsapi] Max retries has been reached, 503!
2012-04-06 15:21:56.738 [DEBUG] [CONNECTION_IP:52234-0#APVH_DOMAIN.GOES.HERE:lsapi] HttpIOLink::continueWrite()...
2012-04-06 15:21:56.738 [DEBUG] [CONNECTION_IP:52234-0#APVH_DOMAIN.GOES.HERE:lsapi] write resumed!
503 error is due to PHP failed/crashed. Run the php script in question manually and see any errors. Also check stderr.log.
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 09:28 AM.



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