httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@organic.com>
Subject Re: Throttling Connections
Date Tue, 06 Aug 1996 18:51:24 GMT
On Tue, 6 Aug 1996, Mark J Cox wrote:

> "Throttling is implemented by checking each incoming URL filename against
> all of the patterns in the throttle file. The server accumulates
> statistics on how much bandwidth each pattern has accounted for recently
> (via a rolling average). If a URL matches a pattern that has been
> exceeding its specified limit, then the data returned is actually slowed
> down, with pauses between each block. If that's not possible (e.g. for CGI
> programs), then the server returns a special code saying 'try again
> later'."

One might point out that in Apache, it would be possible to slow down
*all* data, including CGI. (well, except for nph-scripts). It's something
that will become much easier when we have support for something like
sfio's stacked disciplines, because it could actually be done in a module.
(you could do it now by hacking buff.c, as I did to implement chunking,
but it wouldn't be pretty).

At any rate, this could certainly be a somewhat simple (yet complex
*grin*) module that could be implemented in Apache 2.0; basically, it
would have two phases, a logging and a fixup. the logging phase would keep
track of how much data had been sent from a particular directory, or
server, or whatever. If it got too high, as set by a config file, the
fixups module would stack in a discipline that basically consisted of a
sleep, then a write. And le voila.

> The UKs largest ISP, Demon Internet, has just started giving away free 5Mb
> virtual hosts to *all* their dial-up customers using thttpd.  At ten
> pounds a month for an account and with over 60,000 current customers, I
> predict it will do quite well in Septembers Netcraft survey.

Hmm. Interesting. But not unprecedented; BESTWWWD has almost 6,000 sites
(and is the tenth-most used server), according to Netcraft. And it *only*
serves sites hosted at best.com. 

-- Alexei Kosut <akosut@organic.com>            The Apache HTTP Server 
   http://www.nueva.pvt.k12.ca.us/~akosut/      http://www.apache.org/


Mime
View raw message