[conspire] bandwidth limiting & DSL question

Rick Moen rick at linuxmafia.com
Mon May 12 14:29:57 PDT 2003


Quoting Sean Wolfe-Justice (mailjones at mouseandfrog.org):

> Okay, so a friend approached me with an interesting scenario and I wondered 
> if there might be a penguinish solution. He wants to restrict upload rates 
> on his DSL connection to <=1K while allowing full download rates.
> 
> With a Linux box and two Ethernet NICs, one to his DSL router and one to 
> his LAN, would this be doable? Does Linux have functionality to limit 
> traffic rates in this way?

Funny you should ask that.  Here at chez Linuxmafia, we have a very
similar situation:  This household is on a home aDSL line, with a
theoretical upload cap of something like 256 kbps -- which by all rights
ought to be a lot of bandwidth.  The fly in the ointment is something
called the Wheel of Time FAQ, http://linuxmafia.com/jordan/ , which has
become insanely popular and has been pretty much killing our outbound
bandwidth.

The FAQ is mirrored at several other sites, but, because the FAQ
maintainers couldn't be convinced to take effective measures to even out
the traffic among the sites, and so we had to take corrective measures
at our end:

1.  First, we exchanged the top-level index.html for an index.php that 
picks a random number and, 60% of the time, redirects to one of the
several mirror sites.  This measure helped, but we still had problems
that probably resulted from people's hyperlinks to internal pages
(deeper in the FAQ).

2.  (This is the part directly relevant to your query.)  Since we still
had a problem with saturating the DSL, we _also_ implemented Apache's 
mod_throttle.  You have to load the mod_throttle.so dynamic shared
object, and also have an httpd.conf stanza like the following:

# throttle controls
<IfModule mod_throttle.c>
        # Assert default values.
        ThrottleBps 15000
        ThrottleSlack 100
        ThrottleIndicator green  75
        ThrottleIndicator yellow 85
        ThrottleIndicator red    95
        ThrottleMaxDelay 15
        ThrottleContentType text/html

        # Monitor or throttle users.
        ThrottleUser nobody 0

        # Enable status display handler.
        <Location /throttle>
                SetHandler throttle-info
                Order deny,allow
                Deny from all
                Allow from all
        </Location>
</IfModule>

Our experience suggests that mod_throttle is still a bit buggy, and
causes various problems.  We actually have it turned off at the moment,
as a result.


Completely aside from that, the 2.4 kernel offers some nice
traffic-shaping features at the kernel (as opposed to application)
level.  Here are some relevant links:

http://linux.oreillynet.com/pub/a/linux/2000/08/24/LinuxAdmin.html
http://lartc.org/
http://talk.trekweb.com/~jasonb/articles/linux_tc_minihowto.shtml

I haven't played with those things, so can't fairly comment further.

-- 
Cheers,           find / -user your -name base -print | xargs chown us:us
Rick Moen
rick at linuxmafia.com



More information about the conspire mailing list