[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

A heads up

Something not covered in the manual (and not discussed yet on this list as far as I can see) is the effect of keep-alives on TUX. Don't get me wrong, TUX handles them beautifully; However, I found myself debugging a seemingly impossible bug -- the page would always come up, but the images/stylesheets would be intermittently missing.

I found that once TUX passes the socket, it has no more interaction with the socket from that moment on. This means that if Apache or some other web server keeps the connection open for the second request, third request, etc., TUX will have nothing to do with it even if it's a static file with the appropriate permissions.

I came across this because my back-end server did not handle static content at all (I was relying on TUX for this). TUX would get the page request, not see the static file because the page is dynamic, Apache would handle the request, leave the connection open, get the second request from the browser, not find a handler for that URL, return a 404, and close the connection. The browser would open a connection again for the third request and get TUX again, this time serving the static content.

The effect of course is that the page would come up with no stylesheet, but all of the images would load. Since expiry was set for some content, a reload would alternate the missing item.


I'm sending this email as a cautionary tale for others so that they don't waste time in frustration. In situations like this, disabling keep-alives on the dynamic server will solve the problem. Unfortunately, this requires the tear-down/rebuild step for a new socket on every page request, but c'est la vie.

The only real solution that I can see would be to add support to TUX for watching the socket after it has passed it to userland -- in other words, make it more like a full proxy instead of a simple relay race.

If anyone has any ideas on this, I'd love to hear them. Unfortunately this is a programming task beyond my current abilities to fix -- I can fix simple kernel bugs, but I don't add significantly new functionality.

- Miles

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []