[Varnish] #792: Bandwidth management / rate-limiting

Varnish varnish-bugs at varnish-cache.org
Mon Mar 7 13:24:07 CET 2011


#792: Bandwidth management / rate-limiting
-------------------------+--------------------------------------------------
 Reporter:  tmagnien     |       Owner:  phk                 
     Type:  enhancement  |      Status:  new                 
 Priority:  normal       |   Milestone:  Later               
Component:  varnishd     |     Version:  trunk               
 Severity:  normal       |    Keywords:  bandwidth rate-limit
-------------------------+--------------------------------------------------
Changes (by kristian):

  * milestone:  => Later


Old description:

> 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

New description:

 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

--

Comment:

 Sorry for the response-time. We've discussed this back and forth several
 times, but apparently never got back to you, please accept our apologies.

 It doesn't look like we'll add this for Varnish 3.0, and given the nature
 of vmods, it might be a more suitable place in the future, but for now,
 I'm just moving this to 'later'.

-- 
Ticket URL: <http://varnish-cache.org/trac/ticket/792#comment:2>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list