Like the previous post about
proxy squid and
squid delay pools, on this occasion I give a simple example configuration squid delay pools. Previously must understand some common terms in the delay pools :
delay_pools
delay_pools can be defined as a part / pool, which states how many parts / pool that will be made, for example:
delay_pools 1
Note : there is only 1 pools that we enforce
delay_class
delay_class states of the rules of each section / pool that has been defined in the delay-pools option. There are three classes are supported :
• Class 1: All access is restricted to a single bucket, that is one rule for all the networks.
• Class 2: All Access is restricted to a single aggregate bandwidth with two parameters. The first parameter defines how the maximum bandwidth throughout the network, the second parameter defines a more specific bandwidth to each client.
• Class 3: The bandwidth that defines in detail. The first parameter defines how the maximum bandwidth throughout the network, the second parameter defines how much bandwidth is normally obtained by the client, and third parameters are obtained defining client bandwidth when accessing certain files specific,
for example:
delay_class 1 3
Note : pool 1 has 3 classes, meaning there will be 3 rules in the pool 1
delay_access
delay_access disallow access to anyone (acl) who may use this delay pools. important to remember that should the limit be sure to determine in the end with
deny all, to declare that outside acl is not allowed to use
delay pools, for example:
delay_access 1 allow localnet
delay_access 1 deny all
delay_parameters
This is the most important part of the delay pools to give every delay rules established pools. delay parameter has a format that is tailored to the type / class is used. But every type of wear is the standard format 1
restore /
max.
restore indicates the maximum data rate that can be passed when the price had exceeded
max, in units of bytes / second
max showing her big files or bucket that can be passed without delay through the process. in units of bytes.
To note the above is the price of the unit is restored where we often receive / rent / buy bandwidth from the provider in units of bits / second rather than bytes / second. While speed unit shown by Microsoft at the time of downloading files is bytes / sec.
While the units of max price is in conformity with the daily habits, which we give quantities bytes in the files.
1 byte = 8 bits.
This is where the bandwidth limitations rules apply. Max is a condition in which we have all the bandwidth quota or while not at its peak usage. Restore is a condition when the bandwidth reaches its peak, and each rule will get a maximum bandwidth of the price we restore the set.
delay_parameters 1 -1/-1 24000/32000 16000/32000
Ket:
Pool 1 has 3 classes.
Class 1 has a -1/-1 value means the overall bandwidth allocated to the entire client network squid.
Class 2 has 24000/32000 value means each client will get the squid maximum bandwidth allocated 32,000 bytes / second or 256 kbps and as high traffic will only get a maximum of 24,000 bytes / second or 192 kbps.
Class 3 has a 16000/32000 value meaning when download a file, the client will get the squid maximum bandwidth allocated 32,000 bytes / second or 256 kbps and as high traffic will only get a maximum of 16,000 bytes / second or 128 kbps.
The following simple example squid delay pools
Example 1
acl all src 0.0.0.0/0.0.0.0
acl admin src 192.168.1.250/255.255.255.255
acl server src 192.168.1.251/255.255.255.255
acl general src 192.168.1.0/255.255.255.0
acl staff src 192.168.1.1 192.168.1.111 192.168.1.2 192.168.1.4 192.168.1.71
delay_pools 3
delay_class 1 1
delay_parameters 1 -1/-1
delay_access 1 allow admin
delay_access 1 allow the server
delay_access 1 deny all
delay_class 2 1
delay_parameters 2 1500/64000
delay_access 2 allow staff
delay_access 2 deny all
delay_class 3 1
delay_parameters 3 1000/32000
delay_access 3 general allow
delay_access 3 deny all
Note :
- admin and server with unlimited bandwidth
- staff with a bandwidth of 1.5 Kbytes / sec, when files are accessed over 64Kbytes
- common with bandwidth 1 Kbytes / sec, when files are accessed by more than 32 Kbytes
Example 2
acl multimedia url_regex -i \. mp3 $ \. rm $ \. mpg $ \. mpeg $ \. avi $ \. dat $
delay_pools 1
delay_class 1 1
delay_parameters 1 1000/16000
delay_access 1 allow multimedia
delay_access 1 deny ALL
Note :
Delay pools are used to restrict download files for a particular extension.
Use the acl url_regex to restrict download multimedia files up to 1 KBytes / sec.
Example 3
acl JAM_KANTOR time SMTWHFA 07:00-18:00
delay_pools 2 delay_class 1 2
delay_parameters 1 24000/32000 -1/-1
delay_access 1 allow JAM_KANTOR
delay_access 1 deny all
delay_class 1 2
delay_parameters 2 8000/8000 -1/-1
delay_access 2 allow research ! JAM_KANTOR
delay_access 2 deny all
Note :
In office hours (07:00 - 18:00) given speed to 256 kbps on each host, and outside office hours are given only up to 64 kbps speed.
Read More |  |