In fact my problem is with users who download large files from internet in my network.
I have a Squid cache/proxy server in my network that is placed between my network and the Internet.
I thought terminating connections that is alive for a long time maybe helps to prevent users downloading large files. So ask it in SO in this post but didn't get clear answer. it seems it's impossible with Squid. :-/
Now, one solution that also suggested in that post is limiting bandwidth for each user: We just give a suitable bandwidth to each user and user can do anything (even downloading) without bothering others.
But as far as i know Squid can only assign some static bandwidths to users. So any user has a particular static bandwidth that cannot be changed. I seems this is not fair nor optimum, Because in idle situations (when little users are requesting) we should give them more bandwidth than their share in busy situations.
So in a fair system the bandwidth should be divided between available users considering a priority (some users should have more share than others). The share of any user depends on all available users. more users less share. Something like this:
UserBandwidth = (OverallAllBandWidth / NumberOfCurrentUsers)
If in one moment we only have one user, we should assign all bandwidth to him.
Is this solution possible with Squid?
Is it possible with any other software? How about Linux itself? I heard about some abilities in linux kernel for traffic shaping.
If it's impractical, what other solution would you suggest in order to:
- prevent users from downloading (specially HTTP downloads)
- enforce a bandwidth limit that is fair and certainly dynamic