Apache mod_bw

user-pic
Vote 0 Votes

Apache Bandwidth Mod
wget http://ivn.cl/files/source/mod_bw-0.92.tgz
tar zxf mod_bw-0.92.tgz
apxs -i -a -c mod_bw.c
or
apxs2 -i -a -c mod_bw.c

httpd.conf 加入 config
例: 來自 192.168.0.0/16 不限速, 最大連線數 50, 其他 share 1M Bytes/s (8Mbps), 最大連線數 100,
all 一定要放在最後, 順序有差, 若放在前面, 就會先 match 到而套用設定
mod_bw 的限速都是 by IP group 的, 並非 per IP, 即某 IP group 共用指定頻寬及最大連線數
BandWidthModule On
ForceBandWidthModule On
BandWidth 192.168.0.0/16 0
BandWidth all 1000000
MaxConnection 192.168.0.0/16 50
MaxConnection all 100 # 超過此數目, 會回應 503: Service Temporarily Unavailable
IP 欄位, 可以用 USER AGENT(支援 RE), 例如 "u:^Mozilla/5(.*)" "u:wget"
若再加入以下可以用 http://yourhost/modbw 看簡單的統計
<location /modbw>
SetHandler modbw-handler
</location>

ref. mod_bw v0.92 Readme

About this Entry

This page contains a single entry by Pank published on May 19, 2014 11:13 PM.

Google Geocoding API limit was the previous entry in this blog.

PHP RePOST data is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives