• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to limit bandwidth in Squid - Part 4

57

To limit the bandwidth in SQUID

Squid proxy server is used to limit bandwidth usage for each user (or) for a whole network using classes. In this article we will learn how to limit bandwidth using delay class 1 and class 2.

To block with keywords and extensions in Squid visit,
https://www.linuxhelp.com/how-to-block-keywords-and-extensions-in-squid-2/

To configure Squid visit,
https://www.linuxhelp.com/how-to-configure-acl-rule-by-timing-and-browser-in-squid/

To limit bandwidth in Squid visit,
https://www.linuxhelp.com/how-to-limit-bandwidth-squid/

Class 1 type delay

Configuring the limitation of bandwidth using class 1 delay. In this we have to mention the delay pool. Delay pools allows you to limit the traffic for clients.

syntax :

acl test src single_ipaddress (or) network_address
delay_pools total_poolcount
delay_class pool class_type
delay_parameters pool aggregate

Open the config file located in /etc/squid/

[root@linuxhelp~]# vim /etc/squid/squid.config

Add the following lines into it.

acl test src 192.168.5.219 192.168.5.63    192.168.7.219
delay_pools 1
delay_class 1 1
delay_parameters 1 8000/8000
delay_access 1 allow test

Explanations

  • Mention the source acl name as “ test” , entered the IP addresses.
  • Mention “ delay_pools “ and next 1 indicates,only one pool is to be created.
  • Mention “ delay_class” . Here, the first 1 indicates pool count order and the second 1 indicates the class type.
  • Mention “ delay_parameters” and next 1 indicates pool count order and next is the maximum allowable bandwidth usage(64kbps) for the IP’ s comes under the acl name test.
  • Mention “ delay_access” and 1 is the pool count order and next is “ allow test” .

Calculation to get the aggregate value

For 64kbps = (64/8)*1000 = 8000

calculation

Restart the Squid services

[root@linuxhelp ~]# service squid reload

In the below snap, you can see the download takes much time


downloading snap

Class 2 type delay

Now Configure the limitation of bandwidth using class 2 delay.

syntax
acl test src network_address
delay_pools total_poolcount
delay_class pool class_type
delay_parameters pool aggregate individual

Open the config file located in /etc/squid/

[root@linuxhelp~]# vim /etc/squid/squid.config


Add the following lines into the config file.

acl test sec 192.168.5.0/24
delay_pools 1
delay_class 1 2 
delay_parameters 1 256000/256000 64000/64000
delay_access 1 allow test


Explanation

  • Mention the source acl name as “ test” , entered the IP addresses.
  • Mention the “ delay_pools “ and next 1 indicates,only one pool is to be created.
  • Mention the “ delay_class” .Here the first 1 indicates pool count order and the 2 indicates the class type 2.
  • Mentioned “ delay_parameters” and next 1 indicates pool count order and next is the maximum allowable overall bandwidth (2Mbps) for the 192.168.5.0/24 network. The next(512kbps) is the maximum allowable bandwidth for individual IP comes under the network.

Configuration file

Restart the Squid services

[root@linuxhelp ~]# service squid reload

Open the browser and start the download. You can see that the download speed is limited as per the rule mentioned.

output

Tags:
owen
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

What is Internet object caching?

A

Internet object caching is a way to store requested Internet objects (i.e., data available via the HTTP, FTP, and gopher protocols) on a system closer to the requesting site than to the source. Web browsers can then use the local Squid cache as a proxy HTTP server, reducing access time as well as bandwidth consumption.

Q

What Operating Systems does Squid support?

A

The software is designed to operate on any modern Unix system, and is known to work on at least the following platforms:

Linux
FreeBSD
NetBSD
BSDI
OSF and Digital Unix
IRIX
SunOS/Solaris
NeXTStep
SCO Unix
AIX
HP-UX
OS/2

Q

Does Squid run on Windows NT?

A

Recent versions of Squid will compile and run on Windows/NT with the GNU-Win32 package.

However, Squid does not yet perform well on Windows/NT.

Q

Does Squid support SSL?

A

Squid can proxy SSL requests. By default, Squid will forward all SSL requests directly to their origin servers. In firewall configurations, Squid will forward all SSL requests to one other proxy, defined with the ssl_proxy directive.

Q

What is main terms of using the "Squid"?

A

Squid is a high-performance proxy caching server for web clients, supporting FTP, gopher, and HTTP data objects. Unlike traditional caching software, Squid handles all requests in a single, non-blocking, I/O-driven process.

Squid keeps meta data and especially hot objects cached in RAM, caches DNS lookups, supports non-blocking DNS lookups, and implements negative caching of failed requests.

Squid supports SSL, extensive access controls, and full request logging. By using the lightweight Internet Cache Protocol, Squid caches can be arranged in a hierarchy or mesh for additional bandwidth savings.

Related Tutorials in How to limit bandwidth in Squid - Part 4

Related Tutorials in How to limit bandwidth in Squid - Part 4

How to limit bandwidth in Squid - Part 4
How to limit bandwidth in Squid - Part 4
Jun 28, 2016
How to install squid proxy server on freeBSD
How to install squid proxy server on freeBSD
Feb 10, 2017
How to block with keywords and extensions in SQUID - Part 2
How to block with keywords and extensions in SQUID - Part 2
Jun 22, 2016
How to Configure Reverse Proxy with Squid in CentOS
How to Configure Reverse Proxy with Squid in CentOS
Dec 9, 2016
How to install Squid in Webmin
How to install Squid in Webmin
Aug 26, 2017
How to Compile Squid Proxy Server 4.7v on CentOS 7.6
How to Compile Squid Proxy Server 4.7v on CentOS 7.6
Jun 14, 2019
How to use Ntopng using Squid proxy server
How to use Ntopng using Squid proxy server
Sep 2, 2017
How to Install and Configure Squid Proxy in Ubuntu 20.4.1
How to Install and Configure Squid Proxy in Ubuntu 20.4.1
Nov 28, 2020

Related Forums in How to limit bandwidth in Squid - Part 4

Related Forums in How to limit bandwidth in Squid - Part 4

Squid
oliver class=
how to clear squid cache
Feb 7, 2017
Squid
owen class=
How to change default logformat in squid access log
Sep 1, 2017
Squid
hobbs class=
WARNING: Could not determine this machines public hostname. Please configure one or set visible_hostname.
Sep 21, 2017
Squid
oliver class=
How to allow only one site in SQUID
Feb 11, 2017
Squid
nathan class=
SARG : make[1]: *** [check-macro-version] Error 1
Sep 27, 2017
Squid
owen class=
How to view squid logs in human readable format
Sep 21, 2017
Squid
nicholas class=
How to limit download speed in SQUID
Feb 20, 2017
CentOS
jayce class=
WARNING: Cannot write log file: /var/logs/cache.log /var/logs/cache.log: Permission denied messages will be sent to 'stderr'.
Jun 1, 2019
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Ganesh Konka ?
Zentya 6.1 http proxy configuration

please send link for creating zentyal 6.1 for http proxy and firewall as gateway.

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.