httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <>
Subject Re: Traffic based throttling
Date Tue, 27 Aug 1996 21:12:05 GMT

Not acked.

Made me laugh even though it's serious.

Tomaz Stupnik, KISS wrote:
>We're using Apache for more than a year on several Web servers and 
>are very please to have it. 
>I like its speed and its advanced features like includes...
>But there's one thing I miss very much. A mechanism for limiting 
>throughput generated by some pages. We have more than 300 having 
>their homepages stored on our main server. 
>One of them has a large collection of sexlinks that generates
>>1Gbytes of traffic every day. I don't really want to delete those 
>pages, because I believe in Freedom of speech.
>But I must do something, because 1Gig is a lot. Not for our server 
>but for entire country. The outgoing traffic generated by only one 
>page presents almost 25% of total international traffic generated by 
>the entire Slovenia.
>I found a similar feature in the thhtpd server. There's a short 
>section of its manpage:
>The throttle file lets you set maximum byte rates on URLs or URL
>groups. There is no provision for setting a maximum request rate
>throttle, because throttling a request uses as much cpu as handling
>it, so there would be no point. 
>The format of the throttle file is very simple. A # starts a comment,
>and the rest of the line is ignored. Blank lines are ignored. The rest
>of the lines should consist of a pattern, whitespace, and a number.
>The pattern is a simple shell-style filename pattern, using ? and *,
>or multiple such patterns separated by |. 
>The numbers in the file are byte rates, specified in units of bytes
>per second. For comparison, a v.32b/v.42b modem gives about 1500/2000
>B/s depending on compression, a double-B-channel ISDN line about 12800
>B/s, and a T1 line is about 150000 B/s. 
># throttle file for
>*               100000  # limit total web usage to 2/3 of our T1
>*.jpg|*.gif     50000   # limit images to 1/3 of our T1
>*.mpg           20000   # and movies to even less
>jef/*           20000   # jef's pages are too popular
>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'. 
>                                                 ++Tomaz

Rob Hartill (
The Internet Movie Database (IMDb)
           ...more movie info than you can poke a stick at.

View raw message