[Varnish] #792: Bandwidth management / rate-limiting
Varnish
varnish-bugs at varnish-cache.org
Thu Oct 7 11:21:32 CEST 2010
#792: Bandwidth management / rate-limiting
-------------------------+--------------------------------------------------
Reporter: tmagnien | Owner: phk
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: normal | Keywords: bandwidth rate-limit
-------------------------+--------------------------------------------------
Hi,
Here is a patch to allow for rate-limiting on specific objects / url /
etc. It uses vmod and looks like this in the VCL :
{{{
sub vcl_recv {
if ( req.url ~ "^/bigone.ts$" ) {
std.set_bandwidth(20000);
}
}
}}}
This will limit the delivery at 20000 bytes/sec.
The idea behind this (eh, who would like to slow down delivery with a web-
accelerator ?) is the following : mobile users watching a video usually
watch the first N seconds and stop. But as they start watching, the device
downloads at full speed in order to fill up its cache. The result is that
a lot of downloaded data are never used, so why wouldn't we limit the
download rate to the rate at which the video is encoded ? This allows to
decrease the overall data transfer, which is not a bad idea on mobile
networks.
Note that this is just a "testcase" patch : the "sleep(1)" would better be
something more precise but that's the main idea.
All remarks welcome.
Thanks,
Thierry
--
Ticket URL: <http://varnish-cache.org/trac/ticket/792>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list