On Wed, Mar 24, 2010 at 3:32 AM, Michael Ludwig <michael.lud...@xing.com> wrote: > Am 24.03.2010 um 00:39 schrieb Adam Prime: >> Michael Peters wrote: >>> On 03/23/2010 05:28 PM, Michael Ludwig wrote: >>> >>>> What could be done at the connection level? >>> >>> Anything that might involve keep alive connections: where the same >>> connection serves multiple requests. Probably not that useful for HTTP, >>> but might be for other protocols. >>> >> >> Fred did something fancy (connection rate limiting) with $c->pnotes >> recently. see his post about it here: >> >> http://marc.info/?l=apache-modperl&m=124217947427395&w=2 > > That's interesting, thanks. But it makes me wonder: > > # make 'em wait > sleep 5; > return Apache2::Const::HTTP_SERVICE_UNAVAILABLE; > > This puts both the server process and the client to sleep for five seconds > before returning. However, the server process is likely heavy-weight, whereas > the client process is likely light-weight, and easily multi-threaded. So I'm > wondering if this throttler, which seems to have worked fine for Fred, is > viable in the general case.
I really don't know if this sleep was useful; who knows, maybe it is the reverse of useful in that it causes concurrent connections to pile up rather than process them quickly and return to the client. Some clients make a lot of connections in parallel, some in serial, this was meant to target the ones that make connections in serial. Short bursts were the target to throttle as opposed to a large number of connections at once.