Apache: discerning between a client disconnect and an Apache-enforced timeout

20 views Asked by At

I am running an Apache server that services clients with large amounts of binary data read from a file using the wsgi python module. These clients sometimes are extremely slow at consuming the data. It can be seconds or even minutes that they are effectively "sleeping" so I have the config parameter "TimeOut" set to a very high value. This seems to work well for my rather odd use-case. However, I see disconnects at times far under the timeout value. SOMEtimes, these disconnects are the client forcefully terminating the connection (think: control-c on a lengthy CURL command) but sometimes it looks like Apache is terminating the connection. But I am not able to discern between the two from the log messages in the logs.

I have LogLevel configured to "debug". When the client terminates the connection I see this in the error_log:

mod_wsgi.c(3455): [client ip-address:port] mod_wsgi (pid=1188): Client closed connection. Unfortunately, when Apache forcefully disconnects, I ALSO see EXACTLY the same message. I also have added %X to the LogFormat config and that yields the char 'X' output in the access_log session message when the connection is broken. Unfortunately this ALSO does not discern between the client aborting the connection or the server (apache) aborting the connection.

Is there some log setting I can enable that will help me discern between these two disconnect events? I'd like to see something like: "Timeout exceeded - terminating client connection" or similar.

0

There are 0 answers