{"id":141,"date":"2017-10-09T09:23:00","date_gmt":"2017-10-09T09:23:00","guid":{"rendered":"https:\/\/linuxadmin.melberi.com\/uncategorized\/squid-delay-pools-howto"},"modified":"2017-10-09T12:36:45","modified_gmt":"2017-10-09T12:36:45","slug":"squid-delay-pools-howto","status":"publish","type":"post","link":"https:\/\/www.melberi.com\/linuxadmin\/squid\/squid-delay-pools-howto","title":{"rendered":"Squid delay Pools &#8211; Per User IP Browser Window and Bandwidth Limit"},"content":{"rendered":"<p>How to configure squid delay Pools with Per User, Per IP, Browser, Window based Restriction, bandwidth Management, YouTube Streaming, Upload, Bucket<\/p>\n<div dir=\"ltr\" style=\"text-align: left;\">\n<h2><u><b>Squid delay pools Configuration Examples<br \/>\n<\/b><\/u><\/h2>\n<p>User based bandwidth Restriction, browser window based limit Examples.<\/p>\n<p>Delay pools are used for limiting the bandwidth of web traffic. We can restrict bandwidth based on source ip address, destination ip address, source domain, and destination domain.<\/p>\n<h3><u><b>1) URL, keyword based bandwidth restriction <\/b><\/u><\/h3>\n<p>This will limit the bandwidth for the following keywords video.domain.com mail cricket<\/p>\n<div style=\"background-color: #cccccc;\"><b>acl group1 url_regex -i video.domain.com mail cricke<\/b><\/div>\n<div style=\"background-color: #cccccc;\"><b>delay_pools 1<br \/>\ndelay_class 1 1<\/b><br \/>\n# 256 Kbit\/s fill rate, 1024 Kbit\/s reserve<b><br \/>\ndelay_parameters 1 32000\/128000<br \/>\ndelay_access 1 allow group1<\/b><\/div>\n<h3><u><b>2) IP Based Restriction<\/b><\/u><\/h3>\n<p>Below configuration will restrict bandwidth for the ip range 10.5.1.1-10.5.1.255 and allow full bandwidth for the rest of all<b><br \/>\n<\/b><\/p>\n<div style=\"background-color: #cccccc;\"><b>acl ipgroup src 10.5.1.1-10.5.1.255\/32<\/b><\/div>\n<div style=\"background-color: #cccccc;\"><b>delay_pools 1<br \/>\ndelay_class 1 1<\/b> <b><br \/>\n<\/b># 256 Kbit\/s fill rate, 1024 Kbit\/s reserve<b><br \/>\ndelay_parameters 1 32000\/128000<br \/>\ndelay_access 1 allow ipgroup<\/b><\/div>\n<div style=\"background-color: #cccccc;\"><b>delay_access 1 deny all<\/b><\/div>\n<h3><u><b>3) User group based restriction<\/b><\/u><\/h3>\n<p>Restrict bandwidth for user1,2,3 <b><br \/>\n<\/b><\/p>\n<div style=\"background-color: #cccccc;\"><b>acl restuser proxy_auth user1 user2 user2<\/b><\/div>\n<div style=\"background-color: #cccccc;\"><b>delay_pools 1<br \/>\ndelay_class 1 1<\/b> <b><br \/>\n<\/b># 256 Kbit\/s fill rate, 1024 Kbit\/s reserve<b><br \/>\ndelay_parameters 1 32000\/128000<br \/>\ndelay_access 1 allow<\/b><b> restuser <\/b><b>\u00a0<\/b><\/div>\n<div style=\"background-color: #cccccc;\"><b>delay_access 1 deny all<\/b><\/div>\n<h3><u><b>4)time based bandwidth limit<\/b><\/u><\/h3>\n<p>For time based bandwidth limiting, use the below acl<br \/>\nacl Night_time time SMTWHFA 20:00-24:00<br \/>\nacl Morning_time time SMTWHFA 00:00-08:30<\/p>\n<h3><u><b>Delay Class<\/b><\/u><\/h3>\n<p>Class of the delay pool used is defined using this tag. There must be exactly one delay_class line for each delay pool. There are five categories of delay classes.<\/p>\n<p><b>class 1\u00a0\u00a0 \u00a0 <\/b>Everything is limited by a single aggregate bucket.<br \/>\n<b>class 2\u00a0\u00a0 \u00a0 <\/b>Everything is limited by a single aggregate bucket as well as an &#8220;individual&#8221; bucket chosen from bits 25 through 32 of the IP address.<br \/>\n<b>class 3\u00a0 <\/b>Everything is limited by a single aggregate bucket as well as a &#8220;network&#8221; bucket chosen from bits 17 through 24 of the IP address and a &#8220;individual&#8221; bucket chosen from bits 17 through 32 of the IP address.<br \/>\n<b>class 4<\/b>\u00a0 Everything in a class 3 delay pool, with an additional limit on a per user basis. This only takes effect if the username is established in advance &#8211; by forcing authentication in your http_access rules.<br \/>\n<b>class 5<\/b>\u00a0 Requests are grouped according their tag<\/p>\n<h3><u><b>5) Limiting bandwidth usage both overall and per-user <\/b><\/u><\/h3>\n<div style=\"background-color: #cccccc;\"><b>acl all src all<br \/>\ndelay_pool_count 1<br \/>\ndelay_class 1 2 # delay class2<\/b><\/div>\n<p>#overall speed(1MB=1000\/8*1000=125000) and the per-IP speed<b style=\"background-color: #cccccc;\">(25k)<br \/>\ndelay_parameters 1 125000\/125000 25000\/25000<br \/>\ndelay_access 1 allow all<\/b><\/p>\n<div style=\"color: #999999;\"><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How to configure squid delay Pools with Per User, Per IP, Browser, Window based Restriction, bandwidth Management, YouTube Streaming, Upload, Bucket Squid delay pools Configuration Examples User based bandwidth Restriction,&#8230; <a href=\"https:\/\/www.melberi.com\/linuxadmin\/squid\/squid-delay-pools-howto\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[84],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/141"}],"collection":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/comments?post=141"}],"version-history":[{"count":4,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/141\/revisions"}],"predecessor-version":[{"id":595,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/141\/revisions\/595"}],"wp:attachment":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/media?parent=141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/categories?post=141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/tags?post=141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}