Limit the bandwidth used by an IP Address in Squid3(Ubuntu 10.04)
hai guys,
i configured Squid3 server in my Ubuntu 10.04.Now the ip based and content based blocking is working fine.Now i want to configured bandwidth allocation of ip address and group ip address..pls give the solution with regards Vijtih P A |
For this you have to user Bandwidth Throttling in Squid.
It is done using Delay Pools. Delay pools uses bucketing system. Quote:
Quote:
Quote:
Quote:
Code:
/etc/squid/squid.conf Here is an example: Code:
acl superusers src 192.168.1.1 192.168.1.2 192.168.1.3 After creating the users you have to allow them to access the internet. Below line specifies for allowing the mentioned labeled users. Code:
http_access allow superusers The example is as follows: We are having 512Kbps pipe line connection. We want to divide it into segments one for the special users, web servers and the other for the normal users in the organization. The special users and the web servers are given 384Kbps speed and the remaining 128Kbps for the normal users. Delay Pools for super users: Check for the delay pools section in the squid.conf file. Start the configuration for delay pools as follows ================================== ########## Delay Pools############ ================================== Code:
delay_pools 2 ==================================================== ######### Defining Delay pool 1 in class 2 ######### ==================================================== Code:
delay_class 1 2 Why we are using delay class 2 here? The first part on the second line ie defines the pool One(1) The second part on second line defines the aggregate 48000/48000(restore/max). where restore is the number of bytes (not bits - modem and network speeds are usually quoted in bits) per second placed into the bucket, and maximum is the maximum number of bytes which can be in the bucket at any time. The third part on second line is individual buckets again 48000/48000(restore/max). All the special users and the web servers should obtain the same speed of 384 Kbps. The third line allows the super users to fall in that bucket. ===================================================== ######### Defining Delay pool 2 in class 3 ######### ===================================================== Delay Pools for normal users: Code:
delay_class 2 3 The first part on the second line defines the pool Two(2) of class three(3) The second part on second line defines the aggregate 32000/32000(restore/max) as aggregate (ie for whole). The third part on second line is network bucket. We have defined here 8000/8000 . The fourth part on second line is for individual. The third line specifies to throttle all the users except the super users. How to check: First set proxy settings in your browser as follows: Go to any client machine and open an IE(Internet Explorer). Quote:
Keep a note on the download pop-up box which shows the speed limits in "kbps". When we start downloading note on the pop-up box the speed limits in kbps shows high value and then slowly gets decreased. This means when you start downloading the bucket gets filled and slowly it decreases and becomes stable to the specified limit in Kbps according to the configuration. Remember again as i told restore value is used to set the download speed, and the max value lets you set the size at which the files are to be slowed down from. |
thanks prayag........
i have one doubt remaining... whether it will effect speed of LAN Copying (System to system)? |
No it should not affect.Squid controls HTTP traffic
|
hai prayag,
can u explain detail in "delay_parameters 2 32000/32000 8000/8000 16384/16384" i think 32000/32000 is aggregate speed 16384/16384 is a normal user speed whatz that 8000/8000? |
The third part on second line is network bucket. We have defined here 8000/8000 . Its used just for example.
|
Hi,
How do you define on squid if i want to delay pool using Class 1 pool: A single aggregate bucket, shared by all users. Tnx |
Hi,
Above example was for reference you have to refer it and try the configurations yourself fist then if you face any problem in installing the services,we are here to help you. Also do Googling for getting the concepts clear.Learn by doing practically the above configuration. |
hai prayag,
here i implement bandwidth allocation in My Company.... Butz not loading even google page My configuration ACl Conf acl superusers src 192.168.1.100 192.168.1.6 192.168.1.3 acl lan src 192.168.1.0/24 http_access allow superusers http_access allow lan delay pool conf delay_pools 2 delay_class 1 2 delay_parameters 1 150000/150000 150000/150000 delay_access 1 allow superusers delay_class 2 3 delay_parameters 2 110000/110000 8000/8000 100000/100000 delay_access 2 allow !superusers Net details 2Mbps connection super user can download limit upto 1.2Mbps normal user 800Kbps whether my configuration is correct? |
All times are GMT -5. The time now is 01:02 PM. |