Re: [squid-users] Acl + Delay Pool based on Size

From: James Sutherland <[email protected]>
Date: Mon, 30 Jul 2007 13:10:23 +0100

>>> On 30/07/2007 at 12:38, Kris <christian@wanxp.com> wrote:
> Dear,
>
> is it possible ? ex : i want to set a delay pool for limit the bw if
> someone download file bigger than 20Mb. and if lower than 20Mb it`ll be
> no delay pool. i know how to use delay pool but i dont know how to set
> ACL to lock the max size >.< any clue

It can't be done *reliably*, because the only sure way to know a file
is over 20Mb is when you've already received the first 20Mb and more
data arrives! (Much like a phone call: you can't tell how long it is until
it's over.)

The server *can* include a Content-Length which will tell you how
big the file is - or it can just start sending data and close the connection
once the whole thing has been transferred, at which point you have
no idea how much more data will be sent until you've actually got it!

You should be able to set an ACL which will match the Content-Length
sent by the server, *if* there is one - but that isn't guaranteed.

You should, however, be able to achieve the results you seem to be
seeking by using a 20Mb 'burst' in the delay pool: a 15Mb download
will not be affected, but a series of 10Mb downloads by a single user
will be.

Downside: a 30Mb download will start off quickly, then drop to your
throttled rate two-thirds of the way through, which isn't quite what
I think you were asking for; upside, it'll work fairly reliably, including
stopping download managers getting around your throttling by
requesting big files in chunks of 10Mb each.

James.
Received on Mon Jul 30 2007 - 06:10:41 MDT

This archive was generated by hypermail pre-2.1.9 : Wed Aug 01 2007 - 12:00:04 MDT