[squid-users] Dynamic delay pools in squid?

Amos Jeffries squid3 at treenet.co.nz
Wed Mar 16 15:36:50 UTC 2022


On 17/03/22 03:37, Alberto Montes de Oca wrote:
> Hi guys, I´d like to implement some bandwidth management using squid 
> delay pools, but so far I can´t find any solution/example to do it 
> dynamically, in my case what I want to accomplish is this:
> I have a 10Mb/s Internet connection, I want to use let´s say 6Mb/s for 
> the standard users, and reserve 4Mb/s for IT users, servers, etc. I want 
> to split the 6Mb/s bandwidth between the connected users at a given 
> time, something like (6Mb / N_users) where N_users is the amount of 
> users connected at a time. If there are 10 users connected they´ll get 
> more bandwidth than if there were 30 users connected. I don´t want to 
> split the bandwidth with a fixed percent for each user. Can this be done?


This is effectively what you are describing:

  acl standard_users ...

  delay_pools 2

  # 6 Mb/s pool for "standard users"
  delay_class 1 1
  delay_parameters 1 786432/-1
  delay_access 1 allow standard_users
  delay_access 1 deny all

  # 4 Mb/s pool for everything else
  delay_class 2 1
  delay_parameters 2 524288/-1
  delay_access 2 deny standard_users
  delay_access 2 allow all


Please be aware that you *will* see what looks like unfair/unbalanced 
use of traffic by users. Simply a side effect of the N_users value 
changing constantly on a per-request basis *within* each second.


Your system QoS features are the place to go for better bandwidth 
management beyond simplistic Mb/s rate limits. Squid is able to classify 
traffic with TOS or NFMARK for the QoS systems to use in their policy 
decisions.
see
  <http://www.squid-cache.org/Doc/config/tcp_outgoing_tos/>
  <http://www.squid-cache.org/Doc/config/tcp_outgoing_mark/>

Amos



More information about the squid-users mailing list