Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2190
  • Last Modified:

Squid and Speed limit

I have linux box with Squid2.6 as proxy server , but i have a problem that when one of the users download via IDM it will consume all bandwidth , is there any way to limit user speed via squid to solve this problem.
0
ahfaris
Asked:
ahfaris
  • 2
  • 2
2 Solutions
 
SiridiviCommented:
You need to create a delay pool, for example:

delay_pools 1
delay_class 1 1
delay_access 1 allow all
delay_parameters 1 64000/64000          # 512 kbits == 64 kbytes per second

Then create an ACL for the user you want to restrict, for example:

acl only512kusers src 192.168.1.0/255.255.192.0
delay_pools 1
delay_class 1 3
delay_access 1 allow only512kusers
delay_access 1 deny all
delay_parameters 1 64000/64000 -1/-1 16000/64000

Check out the Wiki:
http://wiki.squid-cache.org/Features/DelayPools?highlight=%28faqlisted.yes%29
0
 
ahfarisAuthor Commented:
i used the first scenario to limit the download speed to 512000 , the download then limited but the browsing become very slow , why ?
0
 
SiridiviCommented:
The function of the delay pool is to slow down traffic. This is something you'll have to fine tune to get results you can live with. You can give your users a larger pool, set limits based on file size, file type, time of day and so on. There is no catch-all, each network environment is different and you'll have to configure SQUID for the best performance on your network.
0
 
stephenhoekstraCommented:
you can configure separate delay pools, and base them on file extensions.

you create an ACL with these extensions and apply them to a separate delay pool, thus leaving all other traffic uninhibited.

check out http://www.faqs.org/docs/Linux-HOWTO/Bandwidth-Limiting-HOWTO.html#AEN110 for an example, scroll down until you see the magic_words ACL.  the delay pools a further down, towards the end.  it's up to you then to decide which extensions to limit.

if one day you have set this up and find someone is still sucking all your bandwidth, just look in the access.log and see who is downloading what, it could be an extension not listed in your ACL.
0
 
stephenhoekstraCommented:
apology, did not see siridivi mention you can create separate pools while skimming through posts.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now