Re: [squid-users] Limiting user's bandwidth

From: Andrew Beverley <andy_at_andybev.com>
Date: Tue, 26 Oct 2010 22:44:07 +0100

[top posting corrected]

>> Are you just trying to share bandwidth fairly between users? If so, your
>> best bet is to change to one leaf for all your clients, but attach a
>> filter to it that will share bandwidth *by IP address* (see below) - the
>> default is to share by connection. If you want an overall limit you can
>> apply that to the one leaf, and then everybody within it will get their
>> fair share within.
>>
>> If you want people who are downloading/uploading large amounts to get a
>> reduced share, then set up an iptables rule to set a MARK based on the
>> amount of date transferred in that connection. There's a good example at
>> the following web page, although it's currently a work in progress:
>>
>> http://www.andybev.com/index.php/Fair_traffic_shaping_an_ADSL_line_for_a_local_network_using_Linux
>
>
> Will that share the bandwidth pro rata?

By "default", the kernel shares bandwidth by connection, not per user
(this is not Squid specific).

> Say the bandwidth is 10Mbps and you have 10 users, they only get 1 each?
> Otherwise isn't it shared equally anyway?

No, if one is downloading several different files (or using P2P
software), they will get a disproportionate amount of bandwidth.

> There must be a way to apply a kbps limit in case someone is hogging the
> bandwidth?

You can set a limit per IP address as Landy is doing, but it is better
to use tc (and SFQ) to share bandwidth per IP address (using "flow hash
keys nfct-dst divisor") as per the website above.

Andy
Received on Tue Oct 26 2010 - 21:45:03 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 27 2010 - 12:00:05 MDT