Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

So:

  • 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)

or

  • enforce a bandwidth limit that is fair and certainly dynamic

Thanks!

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You could use

acl aclname rep_mime_type mime-type

to block certain mime-types from downloading (eg iso's)

and

reply_body_max_size

to set a ceiling on the biggest files that can be downloaded

you could also use free-sa to analyze your logs to see where the bandwidth is going

http://free-sa.sourceforge.net/

EDIT: Actually squid delay pools will do EXACTLY what you need.

read this article: http://www.howtoforge.com/squid-delay-pools-bandwidth-management

share|improve this answer
    
by rep_mime_type small downloads will be blocked. But reply_body_max_size seems good! did it really block any kind of HTTP downloads? i should try it soon...! –  Isaac Oct 30 '09 at 11:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.