How to limit the download speed after first N mb in Squid?

In my network, when someone is downloading big files, the internet speed is going down for everyone else.

So what I want to do is, when someone starts downloading a file, he will download first 5 megabytes with normal speed, then the speed will go down, for example, to 100kbps.

Is it possible to do it in Squid 2.7?

Cheers


Solution 1:

I don't know your set up, and I don't know squid, and I am not sure that it's as configurable as you need but you could always try 'Trickle'. If you have the a ability you can enforce a policy whereby users use their internet accessing programs through Trickle.

It can be used like this (perhaps through a shell script):

trickle -d 20 -u 5 wget -c http://mydownloads.com/bigfile.zip

This will start 'wget' with the specified options and enforce a maximum download speed of 20kbps and an upload speed of 5kbps while it runs. Of course it can be any other application, it doesn't have to be wget.

[Update]: Have a read of this page: Squid Proxy Server Tutorial Specifically check out point 4. It seems to detail exactly what you're after.