Limit apache bandwidth per user
You can use mod_bw on apache2 to limit the speed of which files get uploaded. Make sure that you have installed this module in your Apache.
Check the bandwidth module installed in your apache:
#/usr/local/apache/bin/apachectl -M |grep mod_bw
Then,
Now create a directory with the username and domain name
/usr/local/apache/conf/userdata/std/2/USERNAME/DOMAIN.COM
eg:- username : heman and domain name: hemanth.com
/usr/local/apache/conf/userdata/std/2/heman/hemanth.com
Create a file “cp_bw_all_limit.conf” paste the contents and save and quit.
This will limit the user bandwidth to 250kb/s.
The reason for this customized setup beacuse if you upgrade apache or do some modification this conf will remain the same. In case of upgrade the customized settings will be erased from the http.conf.
BandwidthModule On
ForceBandWidthModule On
Bandwidth all 10240
MinBandwidth all -1
Servername
Limit al internal users (lan) to 1000 kb/s with a minimum of 50kb/s , and
files greater than 500kb to 50kb/s.
BandwidthModule On
ForceBandWidthModule On
Bandwidth all 1024000
MinBandwidth all 50000
LargeFileLimit * 500 50000
Servername
Limit avi and mpg extensions to 20kb/s.
BandwidthModule On
ForceBandWidthModule On
LargeFileLimit .avi 1 20000
LargeFileLimit .mpg 1 20000
Servername
Using it the “right” way, with output filter by mime type (for text)
to 5kb/s:
BandwidthModule On
AddOutputFilterByType MOD_BW text/html text/plain
Bandwidth all 5000
Servername