plainblack.com
Username Password
search
Bookmark and Share
Subscribe

Installing mod_bw in the WRE

It's simple to implement bandwidth throttling in the WRE via mod_bw. This tutorial assumes that you have shell access to the server and appropriate privileges to install Apache modules.

This was tested on WRE 0.8.3.

  1. Become a priveleged user and download the module source.
    wget http://bwmod.sourceforge.net/files/mod_bw-0.7.tgz
  2. Switch to the WRE environment:
    . /data/wre/sbin/setenvironment.sh
  3. Untar mod_bw. Run the following command to compile it:
    apxs -i -c mod_bw.c
    This installs the module in /data/wre/prereqs/modules
  4. Configure mod_bw in /data/wre/etc/modproxy.conf. Here is a sample config to get you started:

    # Support bandwidth limiting
    AddType application/x-gzip gz
    AddType application/x-bzip2 bz2
    LoadModule bw_module modules/mod_bw.so
    BandWidthModule On
    AddOutputFilterByType MOD_BW application/zip application/x-gzip application/x-bzip2 application/x-tar
    AddOutputFilterByType MOD_BW video/mpeg video/msvideo video/quicktime application/x-iso9660-image
    LargeFilelimit * 512 32768

    This implements bandwidth throttling at 32KB only for the mime types declared above, and only if the file is larger than 512KB.
    Note that the first argument for LargeFilelimit is in KB, and the second is in bytes.

    Note also that we had to define a custom MIME type for gz and bz2 files because these were not in /etc/mime.types on our server. Look at your /etc/mime.types file to determine what types you need to add.
  5. Restart modproxy and you should be set!
    /data/wre/sbin/wreservice.pl --restart modproxy

Troubleshooting

Error - undefined symbol: apr_atomic_cas

See http://4j.blogspot.com/2008/09/fix-for-modbw-when-getting-error.html

Keywords: bandwidth mod_bw

Search | Most Popular | Recent Changes | Wiki Home
© 2012 Plain Black Corporation | All Rights Reserved