Limit bandwidth in apache

7

JUN

09

Limit bandwidth in apache

Recently I had to limit download speed for files on one of my servers and found the perfect tool. mod_bandwidth is an apache module created by Ivan Barrera which gives you the possibility to limit the bandwidth for files or restrict the number of simultaneous connections. It should work for almost any platform (definately on my Windows 2003 Server).

  1. download http://ivn.cl/files/source/mod_bw-0.8.tgz
  2. use Windows Release for Apache 2.2.2 for Apache 2.2.3
  3. copy it to apaches /modules folder
  4. added the following to apache config file httpd.conf:
    LoadModule bw_module modules/mod_bw-2_2_2.dll
    BandWidthModule On
    ForceBandWidthModule On
    BandWidth    all   200000
    BandWidth    123.4 600000
    MinBandWidth all   50000
    
  5. restart apache

Now my apache limits download speed for users to ~200kb per second. Only users comming from IP range 123.4 will have three time as much.

If more than one user downloads, it will be splitted accordingly but everyone will have at least 50kb

4atxmuf9b6

juergen riemer said on 2009-07-17 22:19:53

hello,same name than me....fine....jasonpepper@live.de

Juan Valdez said on 2009-07-21 05:33:22

mod_bw v0.8 - Windows Release for Apache 2.2.9 from http://ivn.cl/

is working fine under Windows 7 Relese Candidate code, 64 bit, with apache_2.2.11-win32-x86-openssl-0.9.8i.msi

today's date is 20 July 2009

Juergen Riemer said on 2009-07-27 13:45:45

@juergen riemer: loool, I had to rewrite my comments controller to deal with comments of users with _my_ name :-) BTW: sorry that I took your domain :-)

@Juan: thanks for that info since I want to replace Vista asap.
is the sum of five and four.