LSWS 4.0.x and AJP app

#1
I'm running into some nasty connection errors (which lead to 503 occuring frequently on my site) with an Django app running trough flup's AJP protocol and a LSWS connector.

Log from flup-ajp django daemon:
Code:
2009-08-26 10:40:38 : Exception caught in Connection
Traceback (most recent call last):
  File "/var/lib/python-support/python2.4/flup/server/ajp_base.py", line 618, in run
    self.processInput()
  File "/var/lib/python-support/python2.4/flup/server/ajp_base.py", line 649, in processInput
    self._forwardRequest(pkt)
  File "/var/lib/python-support/python2.4/flup/server/ajp_base.py", line 707, in _forwardRequest
    req.run()
  File "/var/lib/python-support/python2.4/flup/server/ajp_base.py", line 498, in run
    self._conn.writePacket(pkt)
  File "/var/lib/python-support/python2.4/flup/server/ajp_base.py", line 740, in writePacket
    pkt.write(self._sock)
  File "/var/lib/python-support/python2.4/flup/server/ajp_base.py", line 312, in write
    self._sendall(sock, CONTAINER_PREFIX + struct.pack('>H', self.length))
  File "/var/lib/python-support/python2.4/flup/server/ajp_base.py", line 298, in _sendall
    sent = sock.send(data)
error: (32, 'Broken pipe')
Vhost's external app config:
Code:
Type: Servlet engine
Address: 127.0.0.1:3033
Max Connections: 100
Connection Keepalive Timeout: -1
Initial Request Timeout: 60
Retry Timeout: 3
The flup-ajp django process is run by this command:
Code:
/usr/bin/python $DIR/manage.py runfcgi method=threaded daemonize=false \
        maxrequests=0 \
        maxchildren=300 \
        minspare=30 \
        maxspare=60 \
        protocol=ajp \
        host=127.0.0.1 port=3033
I'm suspecting, that LSWS is the cause here, as using apache with mod-jk on the same flup-ajp django instance (yes! it's lightning fast) yelds no errors at all.

The connection count from LSWS to the app floats between the max allowed connection limit in LSWS while operating normally (no 503 errors), and drops to:
Code:
 ~$ netstat -a -n | grep 3033 | grep ESTABLISHED  | wc -l
29
while the 503 errors occurs.

The bug has been observed on every 4.0.x version. Currently testing with 3.x

Help, please? :)
 
Last edited:

mistwang

LiteSpeed Staff
#2
I think there is somehting that LSWS does not like in the AJP packet sent by flup-ajp, so web server side closed the connection.
If it can be reproduced with certain URL, you can grep 503 error in access log see if it only happen to certain URL.
You can use tcpdump to capture the data exchanged between LSWS and flup-ajp.
 
Top