503 errors with lsws 3.1 + rails

Discussion in 'Ruby/Rails' started by technix, Jul 5, 2007.

  1. technix

    technix New Member


    I was trying to use our litespeed with our application and getting following error:

    2007-07-05 15:07:04.083 [DEBUG] [] HttpExtConnector::tryRecover()...
    2007-07-05 15:07:04.083 [DEBUG] [] trying to recover from connection problem, attempt: #2!
    2007-07-05 15:07:04.083 [DEBUG] [uds://tmp/lshttpd/ubac:_.sock] request [] is assigned with connection!
    2007-07-05 15:07:04.083 [DEBUG] [] [ExtConn] reconnect()
    2007-07-05 15:07:04.083 [DEBUG] [Rails:ubac:/] add child process pid: 23439
    2007-07-05 15:07:04.084 [DEBUG] [] [ExtConn] connecting to [uds://tmp/lshttpd/ubac:_.sock]...
    2007-07-05 15:07:04.084 [DEBUG] [] ExtConn::onWrite()
    2007-07-05 15:07:04.084 [DEBUG] [] request header is done
    2007-07-05 15:07:04.084 [DEBUG] [] ExtConn::continueRead()
    2007-07-05 15:07:04.084 [DEBUG] [] Request body done!
    2007-07-05 15:07:04.084 [DEBUG] [] ExtConn::suspendWrite()
    2007-07-05 15:07:06.343 [DEBUG] Remove pid: 23439
    2007-07-05 15:07:14.043 [DEBUG] [] No response in 10 seconds, possible dead lock, try starting a new instance.
    2007-07-05 15:07:14.044 [DEBUG] [Rails:ubac:/] add child process pid: 23450
    2007-07-05 15:07:16.292 [DEBUG] Remove pid: 23450
    2007-07-05 15:08:04.014 [NOTICE] [] ExtConn timed out while processing.
    2007-07-05 15:08:04.014 [DEBUG] [] connection to [uds://tmp/lshttpd/ubac:_.sock] on request #0, error: Connection timed out!
    2007-07-05 15:08:04.014 [DEBUG] [] [ExtConn] close()
    2007-07-05 15:08:04.014 [DEBUG] [uds://tmp/lshttpd/ubac:_.sock] No Request has been processed successfully through this connection, the maximum connections allowed will be reduced!
    Basically i created a instance from supplied rails template and restarted lsws.

    For same configuration, i tried first with a hello world rails application which works flawlessly. But when I created another instance from same template for our in house app, litespeed doesn't work. The application i am talking about is, a bit complicated in nature and uses socket connections and mutexes.

    I turned on debugging and got above posted errors. Can anyone have a look and say whats wrong here?

    Same application,works with mongrel. I guess there shouldn't be any issue with rails configuration and stuff.
  2. mistwang

    mistwang LiteSpeed Staff

    Please try setting "Max Conns" to 1, if it works, the problem might be the socket connection established during Rails framework initialization, you should close all socket connection at end of your environment.rb. Since LSAPI ruby fork children process off initialized parent process, the file handle of a open socket will be messed up.

    If it does not work either, double check if any shell environment variable need to be set. increase memory limit if more memory is used by your application.
  3. technix

    technix New Member

    It turned out, it was issue with path getting changed when my app is running within ruby-lsapi module. It was looking for a program called cronolog, which was not in path and hence the error.

Share This Page