What tools do I need to limit bandwidth usage?

Discussion in 'Linux Networking' started by George Adams, Feb 12, 2004.

  1. George Adams

    George Adams Guest

    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.linuxforum.com/linux-bandwidth-limit/), advanced Linux
    routing and traffic control
    (http://en.tldp.org/HOWTO/Adv-Routing-HOWTO/), mod_bandwidth for
    Apache2 (http://www.cohprog.com/mod_bandwidth.html), 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!
     
    George Adams, Feb 12, 2004
    #1
    1. Advertisements

  2. George Adams

    Pete Houston Guest

    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://linux-ip.net/articles/htb-and-tcng.html for an example).
    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.

    HTH,

    Pete
     
    Pete Houston, Feb 18, 2004
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.