Ubuntu – Restrict bandwidth of certain website using Squid3

cachePROXYsquidUbuntu

I have a Squid3 server and I'd like to restrict the bandwidth of certain websites.
For example:

How can I make www.example.org/* load at no more than 10KB/s?

Thanks.

Best Answer

Your answer lies within Delay Pools

What you have to do is,

  1. Make an access list that describes your traffic. In this case something like acl LimitedDomains dstdomain example.com
  2. Define how many Delay Pools you need. Delay Pools are different Bandwidth Rules. i.e. delay_pools 2
  3. Next define what class should each Pool be. i.e. delay_class 1 1 which means that Pool 1 will be Class 1 (see bellow about classes
  4. Match each pool with an Access List. i.e.

    delay_access 1 allow LimitedDomains

    delay_access 1 deny all

  5. Then set the parameters of the Pool. The parameters depend on the Class you chose but essentially are the bandwidth limit in Bytes per IP/Network/User. i.e. delay_parameters 10000/10000

For more detailed information on Pools, Classes, etc look here.

Related Topic