Use Bandwidth Mod in Apache to limit the total Bandwidth

Source: Internet
Author: User

Use Bandwidth Mod in Apache to limit the total Bandwidth
Environment:
CentOS release 5.6 + Apache 2.2.22
Mod_bw v0.92
Http://ivn.cl/files/source/mod_bw-0.92.tgz
Mod_bw v0.92 documentation
Http://legacy.ivn.cl/files/txt/mod_bw-0.92.txt
 
Download and install:
# Wget http://ivn.cl/files/source/mod_bw-0.92.tgz
# Tar zxvf mod_bw-0.92.tgz
#/Data/apps/httpd2.2.22/bin/apxs-c-I-a mod_b1_c
Configure VirtualHost
 
<VirtualHost *: 80>
DocumentRoot/data/webapps/www.domain.com
ServerName www.domain.com
 
<Location/>
SetEnvIfNoCase User-Agent "Googlebot" google
Order allow, deny
Allow from all
Deny from env = google
</Location>
 
BandWidthModule On
ForceBandWidthModule On
BandWidth all 131072
</VirtualHost>
 
The <Location/> *** </Location> segment is used to reject the use of Googlebot.
If the link address is not exposed, Google crawls the file for unknown reasons.
Of course, you can write it in robots.txt, but it doesn't take effect quickly.
The following two concepts (case sensitive ):
Bps (bits per second) bit/second is generally used for transmission rate
Bps (bytes per second) bytes/second is generally used for display speed
1 Byte = 8 * 1bit (1 Byte = 8 characters)
What we usually talk about is 2 m bandwidth and 10 M bandwidth, which generally refers to 10 Mbit (10 Mbps)
The unit of BandWidth in the official document: BandWidth [From] [bytes/s]
Therefore, if you want to limit the total bandwidth of a VM to 1 Mbps, then:
 
BandWidth all 131072
 
// (1024*1024) bps/8 = 131072 Bps

From JOM_CH

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.