Costin Manolache wrote:
Great work - but I'm curious, wouldn't be better to explore the alternative direction - i.e. detect when the server is too loaded and send a quick 502 ?
I totally agree, and the way its designed, this is totally doable. so whenever the existing connection count is more than the configured "limit" send a 502 through the acceptor thread and close the connection.

Maybe with some extra logic - like serve existing sessions first,
provide some notifications that can be used by a load balancer ( or pager
:-)
to up more servers, or some notification to be used to disable some
expensive
functionality ?
Yes, that would be a tougher one, trying to correlate a new connection to an existing session. If you wanna do that, you have to let the connection in on a worker thread, and then its pointless.

In a real world situation - I would rather have the server not accept 20.000 connection and do all of them badly. It's in the same line with 'fairness'
and handling slashdot-ing, but in a different way.
I'm thinking of implementing the limit, so that keep alives get turned off if there are too many connections. That way we should still be able still keep everything rolling. In a world where we would get 20k connections, I doubt they would hammer the server like ab does :) so it should still be possible to keep this many connections alive.

Filip

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to