Re: [squid-users] Betr.: [squid-users] How does Squid handle bandwidth distribution

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Thu, 18 Jun 2009 03:37:10 +1200

Arnaud Loonstra wrote:
>>>> Op Wo, jun 17, 2009 om 2:16 nm is in bericht <4A38DEB9.6010501_at_gmail.com> door
> Mark Lodge <mlodgesa_at_gmail.com> geschreven:> Can squid do 'fair bandwidth sharing' ?
>> What i mean is, if there is 1 user online on a 4mg line, that user will
>> be using the entire 4mg line speed, and if there are 2 users online,
>> each user will have 2mg line speed, and so on.
>> I have squid cache set up already, but i just need to know how bandwidth
>> distribution/sharing can be handled
>>
>> Can squid also be used to limit/disconnect users after they have used up
>> their allotted bandwidth?
>>
>> [I have a mikrotik router connected to the adsl (for wireless users)]
>>
>> I would really appreciate your comments and help
>> Thank you
>
> Yes it does, sort of. It's called delay pools. See google i.e.: http://quark.humbug.org.au/publications/squid/aclsquid.html
>
> It might do what you need
>

No. It places a maximum bandwidth cap and speed limit on all applicable
requests, regardless of other traffic. Fair, but not what asked for.

To divide the line evenly between concurrent users is what Squid already
natively does.

This is not noticable becasue HTTP is stateless and defines on 'user' as
one 'request'. There are either N concurrent requests or none. Squid
handle N concurrent requests by reading what it can for one and the
moving on to the next.

Imagine this:
  Given 1 large request + 1 small request. Squid will read the small
request and part of the large request in one cycle.
The small is much more likely to be finished after that cycle, leaving
the large request with a full-bandwidth pipe to suck from in the next.

The result is the small being finished at maybe half speed, and the
large seeing a very light blip in its overall transfer.

Spread this across many dozens of requests all starting and stopping at
different times and it becomes nearly impossible to tell whats "fair"
and whats not.

You can use the delay pools to set caps on each IP or authenticated user
connecting and hope its relatively fair. But there will be spots of
wastage with low visitor counts.

Someone asked recently about having a custom ACL (external_acl_type)
which kicked people into a delay pool when the bandwidth pipe was
reaching capacity. So people only got limited when the network was under
stress or they were downloading a very big file. That seems a nice way
to go about it, but does involve some complexity detecting the load.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE6 or 3.0.STABLE16
   Current Beta Squid 3.1.0.8
Received on Wed Jun 17 2009 - 15:38:23 MDT

This archive was generated by hypermail 2.2.0 : Wed Jun 17 2009 - 12:00:04 MDT