What tools do I need to limit bandwidth usage?

What tools do I need to limit bandwidth usage?

Post by g_adams2 » Sat, 14 Feb 2004 05:19:52

Our church has a Gentoo Linux server with a number of audio files
(sermons mostly) that are available both for streaming (RealAudio) or
downloading. However, since people who download multiple files tend
to kill the bandwidth for RealAudio listeners, I'd really like to put
some rules like this in place:

1) SSH connections (i.e. me connecting remotely) get all the bandwidth
they can consume.

2) RealAudio streaming clients get all the bandwidth left after #1
that they can consume.

3) Web downloaders get all the bandwidth left after #1 and #2 that
they can consume.

3a) No single web downloader can download more than N files at a time.

So ideally, if no-one is using the server and User A wants to download
3 files, then they can have all the server's bandwidth. If User B and
User C connect to stream RealAudio sermons, however, then they will
get as much bandwidth as they need to get a good connection, and User
A will be given ONLY whatever bandwidth is left. And ideally User A
will not be able to download more than, say, 3 files simultaneously.

I can see I have my work cut out for me, so before I dive in too
deeply, I'd like to figure out which area to focus my efforts on.
I've seen tutorials on bandwidth limiting with Squid and CBQ
( http://www.yqcomputer.com/ ), advanced Linux
routing and traffic control
( http://www.yqcomputer.com/ ), mod_bandwidth for
Apache2 ( http://www.yqcomputer.com/ ), and at the moment
I'm not sure where to even start. (I'll give an example - in the
Squid tutorial, the author hints that it's possible to use Squid to
limit downloading traffic over port 80 to, say, 75% of available
bandwidth, but it's NOT possible to increase that to 100% if no one
else is using the bandwidth. So maybe Squid isn't the right tool
after all...?)

I would appreciate anyone who can point me in the right direction and
help me get started. Thank you!

What tools do I need to limit bandwidth usage?

Post by Pete Houst » Fri, 20 Feb 2004 02:11:43

In article < XXXX@XXXXX.COM >,

There are two separate issues here, George. The first is the allocation
of bandwidth to the various types of service and the borrowing of spare
bandwidth between them. This is all covered in the LARTC (Linux Advanced
Routing and Traffic Control) Howto, which is at tldp.org and elsewhere.
You will probably want to look at tcng as well, which will help to save
you from the arcane syntax as far as possible (see
http://www.yqcomputer.com/ ).
Do think about joining the LARTC mailing list as well, lots of good
stuff on there.

The second issue (limiting any one user to N simultaneous downloads) is
application specific. It can be done in Apache (for example), but you
will have to decide what constitutes a user and what constitutes a
download. If the only resource which you are trying to protect is your
bandwidth (as opposed to the server memory or CPU), then just limit the
bandwidth as above and it won't matter to you how many downloads are in
progress if they all proceed at a snail's pace.


Openstrike - improving business through open source