[buug] Bandwidth restriction in Apache

johan beisser jb at caustic.org
Tue Dec 30 14:53:56 PST 2008


On Dec 30, 2008, at 2:01 PM, Wm. F. Honeycutt wrote:

> I have a client who implemented a successful web site in which they  
> rely extensively on Flash and streamed videos.  This is an Apache2  
> installation with a single virtual host.
>
> In the first month of operation, the bandwidth exceeded their  
> maximum and they incurred additional charges for bandwidth usage.
>
> To keep their costs down, they might consider redesigning the site  
> to rely less heavily on video (not a likely option), but I also want  
> to suggest technical means to "throttle" total bandwidth based on  
> individual session usage.  I think that they should initially allow  
> unrestricted bandwidth access,  but if the same session begins to  
> drain resources then reduce throughput to that user.

That's the harder solution. It's easier to simply say "this is the max  
amount of bandwidth this IP can use at any given time."

> Does anyone have suggestions about acceptable ways to solve this  
> problem?  Is this too granular to implement with ease?

It's doable. People charge a bunch of money for this kind of work, I  
know I do.

Look at traffic shaping/bw limit on the load balancer itself (they are  
using one, right?). Since the IP is virtualized, figuring out how to  
throttle and release for spikes in traffic (they are doing some kind  
of BW monitoring, right?) will help, but the better bet is to build a  
smarter front end between themselves and the router their provider uses.

I'd look in to using either OpenBSD pair with PF/CARP or a used F5.

Of course, they could also just upgrade their monthly bw cap to  
something more reasonable for serving videos.

Or, they could serve the videos from something like S3, and use  
Amazons price structure (scales.. decently).



More information about the buug mailing list