May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

mod_cband (Apache 2 module of the traffic control like mod_throttle & mod_bandwidth) usage

As in the past to apache 1 mod_throttle gasanghoseuteubyeol the measure and limit traffic was possible.
Limiting the traffic to the hosting is required. Used in any domain that
Knowing very important job. But,
apache2 could only give this guy writes. Is search. cband found.
mod_throttle and function and the structure and almost identical, mod_bandwidth including the functions of, and
Continued performance improvements have been developed recently was becoming.
Than flattering,? Xml glue that, if data are available in the form of xml,
For hosting a really good module.
[Note] cband the apache 2 module. is not easy apache 1.3.XX 1.3.XX mod_throttle use!

[Feature]
* Apache2 module for traffic restrictions Lightweight
* Per-user bandwidth limit
* Gasanghoseuteubyeol bandwidth limit
* The purpose-specific bandwidth limit
* Limit:
All user bandwidth limit o
o limit download sokje
o Fresh water limit requests per second
o IP vs. Small Areas limit
* Support for virtualhosts
* Support for defined users
* Limit the results confirm a Web-based (/ cband-status)
* Check the results for each user limit (/ cband-status-me)

A. How to Install
cd / usr / local
wget http://cband.linux.pl/download/mod-cband-0.9.7.4.tgz
tar xvfpz mod-cband-0.9.7.4.tgz
cd mod-cband-0.9.7.4
. / Configure – with-apxs = / usr / local / apache / bin / apxs
# # Option Description
# # – With-apxs = / usr / local / apache / bin / apxs: apache apxs to specify the path.
make
make install

Two. Verifying the Installation
– Httpd.conf file
LoadModule cband_module modules / mod_cband.so
You can see that the added lines.
– Apache / modules directory
mod_cband.so
You can see what files are added.

Three. The default setting

====================================
<Location /cband-status>
SetHandler cband-status
Order deny, allow
Deny from all
Allow from IP to open up
</ Location>

<Location /cband-status-me>
SetHandler cband-status-me
</ Location>

<VirtualHost *>
ServerName gnux.co.kr
Document / home / gnux / www
CBandLimit 300Mi
CBandPeriod 1D
CBandExceededURL http://manager.gnux.co.kr/traffic_exceeded.html
</ VirtualHost>
======================================
The configuration file in the domain of gnux.co.kr
Day, 300M (300 * 1024 * 1024byte) is set to provide the traffic.
In terms of as a bit, 2.4Gbit / is to provide a traffic.
If you exceed 300M in one day, “http://manager.gnux.co.kr/traffic_exceeded.html”
Pop up page, if you did not give 503 error page will appear.
You! If you want to without restriction in infants, CBandPeriod like portion is deleted.

Four. Contextual Setting
1) Media Speed Limit
==============================
<VirtualHost *>
ServerName rmohan.com
Document / home / gnux / file
CBandSpeed 1024 10 30
CBandRemoteSpeed 20kb / s 3 30
</ VirtualHost>
==============================
File rmohan.com above settings for the domain
Speed is limited to 1024kbps, and 10 times per second connection,
An example of concurrent users is limited to 30.

2) provide users and ilteuraepik yeongyeolsu limit is exceeded.
==============================
<VirtualHost *>
ServerName  rmohan.com
Document / home / gnux / doly
CBandLimit 100Mi
CBandExceededSpeed 128 5 15
CBandPeriod 1D
</ VirtualHost>
==============================
rmohan.com  above settings for a domain
Day of 100Mbyte provide traffic and
If the second 100M,
Limited to 128bps rate, five times per second connection,
An example of concurrent users is limited to 15.

3) If a user has multiple domains?
==============================
<CBandUser Host_user1>
CBandUserLimit 100Mi
CBandUserPeriod 1D
</ CBandUser>
<VirtualHost *>
ServerName rmohan.com
Document / home/host_user1/aaa
CBandUser host_user1
</ VirtualHost>
<VirtualHost *>
ServerName rmohan.com
Document / home/host_user1/bbb
CBandUser host_user1
</ VirtualHost>
==============================
Set of virtual users to specify that the host_user1 a following.
The user is enables the use of a day 100Mbyte.
Then, aaa.co.kr, bbb.co.kr all of host_user1
Traffic has been set to use.

4) IP range, depending on if you want to limit the speed?
==============================================
<CBandClass Class_1>
CBandClassDst 192.168.0.0/24
</ CBandClass>
<CBandClass Class_2>
CBandClassDst 222.97.189.0/24
</ CBandClass>

<VirtualHost *>
ServerName rmohan.com
Document / home / gnux / intranet
CBandClassRemoteSpeed class_1 50Mbps 10 30
CBandClassRemoteSpeed class_2 300kbps 10 30
</ VirtualHost>
==============================================
For the above configuration, the internal IP 192.168.0.XXX, in
The bandwidth of 50Mbps, and 10 times per second the request, a setting of 30 concurrent users, and
In a different ip range 222.97.189.XXX
300kpbs, one request per second, 30 sets of concurrent users.

5 Check usage.
http:// domain / cband-status
http:// domain / cband-status-me

6. Indicators and unit description (if applicable huge!)

  1) unit.
* Transfer speed unit
o kbps, Mbps, Gbps – bits per second: 1024, 1024 * 1024, 1024 * 1024 * 1024 bps
o kb / s, Mb / s, Gb / s – bytes per second: 1024, 1024 * 1024, 1024 * 1024 * 1024 b / s
o Default: kbps

* Traffic quota units
o K, M, G – bytes: 1000, 1000 * 1000, 1000 * 1000 * 1000 bytes
o Ki, Mi, Gi – bytes: 1024, 1024 * 1024, 1024 * 1024 * 1024 bytes
o base: K

* Time (period), the unit
o S, M, H, D, W – seconds, minutes, hours, days, weeks
o Default: S

2) Directives
(1) Name: CBandDefaultExceededURL
Description: When limit is exceeded, show URL (If you do not specify the error page 503)
Context: Server config
Grammar: CBandDefaultExceededURL URL

(2) Name: CBandDefaultExceededCode
Description: show an error code when the limit has been exceeded
Context: Server config
Grammar: CBandDefaultExceededCode HTTP_CODE
Example: CBandDefaultExceededCode 509

(3) Name: CBandScoreFlushPeriod
Description: scoreboard file record number of requests, mod_cband affects performance.
Default: 1
Context: Server config
Grammar: CBandScoreFlushPeriod number of requests
Example: CBandScoreFlushPeriod 100 (one request every scoreboard every 100 records on file)

(4) Name: CBandSpeed
Description: The maximum speed of the virtual host domain, the number of requests, number of connections set
Context: <Virtualhost>
Grammar: CBandSpeed kbps rps max_conn
kbps – maximum transfer rate per second
rps – the maximum number of requests per second
max_conn – the maximum number of simultaneous connections
Example: CBandSpeed 1024 10 30
The maximum transfer rate is limited to 1024kbps, handle 10 requests per second, a limit of 30 simultaneous connections.

(5) Name: CBandRemoteSpeed
Description: The visitor (IP) of the maximum speed, number of requests, number of connections limit (CBandSpeed and similar, but per-connection settings)
Context: <Virtualhost>
Grammar: CBandRemoteSpeed kbps rps max_conn
kbps – maximum transfer rate per second
rps – the maximum number of requests per second
max_conn – the maximum number of simultaneous connections
Example: CBandRemoteSpeed 20kb / s 3 3
Splice (ip) advised on the maximum 20kb / s, 3 requests per second, limited to 3 simultaneous connections.

(6) Name: CBandClassRemoteSpeed
Explanation: The defined class (ip ranges) for the maximum speed, number of requests, number of connections limit
Context: <Virtualhost>
Grammar: CBandClassRemoteSpeed class_name kbps rps
class_name – class name is already defined (IP range)
kbps – maximum transfer rate per second
rps – the maximum number of requests per second
max_conn – the maximum number of simultaneous connections
Example: <CBandClass googlebot_class>
CBandClassDst 66.249.64/24
CBandClassDst 66.249.65/24
CBandClassDst 66.249.79/24
</ CBandClass>
CBandClassRemoteSpeed googlebot_class 20kb / s 2 3
Class defined above (googlebot_class) The request of 20kb / s transfer rate,
Three requests per second, limited to three simultaneous connections.

(7) Name: CBandRandomPulse
Description: The speed limit in order to generate arbitrary waveforms, the following is how to handle the processing of mod_cband.
When there are too many men is the Auto Off.
Context: Global
Grammar: CBandRandomPulse On / Off

(8) Name: CBandLimit
Description: Sets the limit throughput. (The period set in the CBandPeriod)
Context: <Virtualhost>
Grammar: CBandLimit limit
limit – throughput, use the units: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)
Example: CBandLimit 10M
Transfer the amount of 10M (10 * 1000 * 1000bytes) is limited to.
CBandLimit 10Mi
Transfer the amount of 10M (10 * 1024 * 1024bytes) is limited to.

(9) Name: CBandClassLimit
Explanation: The defined class (ip ranges) throughput for a set limit.
Context: <Virtualhost>
Grammar: CBandClassLimit class_name limit
class_name – class name is already defined (ip ranges)
limit – throughput, use the units: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)

(10) Name: CBandExceededURL
Description: The limit has been exceeded during show URL, if you do not specify a 503 error (virtual host).
Context: <Virtualhost>
Grammar: CBandExceededURL URL

(11) Name: CBandExceededSpeed
Description: The transfer would exceed the amount of time, transfer rate limiting.
Context: <Virtualhost>
Grammar: CBandExceededSpeed kbps rps max_conn
kbps – maximum transfer rate per second
rps – the maximum number of requests per second
max_conn – the maximum number of simultaneous connections

(12) Name: CBandScoreboard
Description: Specifies the virtual host of the scoreboard file. (Required for better performance)
Context: <Virtualhost>
Grammar: CBandScoreboard path
(Path of the Apache (nobody or apache) authority must be writable)

(13) Name: CBandPeriod
Description: The capacity limitations period (After this period, which was measured capacity is cleared.)
Context: <Virtualhost>
Grammar: CBandPeriod period
period – use the units: S (seconds), M (minute), H (hour), D (a), W (weeks)
Example: CBandPeriod 1W (1 Sunday)
CBandPeriod 14D (14 days)
CBandPeriod 60M (60 minutes)

(14) Name: CBandPeriodSlice
Description: The period gilttae shall specify the period of the share.
Defaults: slice_len = limit
Context: <Virtualhost>
Grammar: CBandPeriodSlice slice_length
Example: CBandLimit 100G
CBandPeriod 4W
CBandPeriodSlice 1W
Which is divided into four units per week (4W/1W = 4). Capacity of 100G / 4 = 25G
1 week, 25G, 2 weeks, this split is processed 50G.

(15) Name: <CBandUser>
Description: A new set of virtual users cband
Context: Server config
Grammar: <CBandUser user_name>

(16) Name: CBandUserSpeed
Description: cband virtual user’s speed, the number of requests, limiting the number of simultaneous connections
Context: <CBandUser>
Grammar: CBandUserSpeed kbps rps max_conn
kbps – maximum transfer rate per second
rps – the maximum number of requests per second
max_conn – the maximum number of simultaneous connections
Example: CBandUserSpeed 100kb / s 10 5

(17) Name: CBandUserLimit
Description: cband jeosong capacity limitations of virtual users.
Context: <CBandUser>
Grammar: CBandUserLimit limit
limit – use the capacity, use the units: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)
Example: CBandUserLimit 10M
CBandUserLimit 10Mi

(18) Name: CBandUserClassLimit
Description: cband virtual user-defined class (ip ranges) throughput limit set for
Context: <CBandUser>
Grammar: CBandUserClassLimit class_name limit
class_name – the specified class (IP range) Name
limit – use the capacity, use the units: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)

(19) Name: CBandUserExceededURL
Description: cband virtual users, to show the limit has been exceeded at URL,
If you do not specify a 503 error (virtual host).
Context: <CBandUser>
Grammar: CBandUserExceededURL URL

(20) Name: CBandUserExceededSpeed
Description: cband virtual users, would exceed the amount of transmission time, transmission rate limiting.
Context: <CBandUser>
Grammar: CBandUserExceededSpeed kbps rps max_conn
kbps – maximum transfer rate per second
rps – the maximum number of requests per second
max_conn – the maximum number of simultaneous connections

(21) Name: CBandUserScoreboard
Description: cband virtual users, scoreboard file specification.
Context: <CBandUser>
Grammar: CBandUserScoreboard path
(Path of the Apache (nobody or apache) authority must be writable)

(22) Name: CBandUserPeriod
Description: cband virtual users, capacity limitations period (After this period, which was measured capacity is cleared.)
Context: <CBandUser>
Grammar: CBandUserPeriod period
period – use the units: S (seconds), M (minute), H (hour), D (a), W (weeks)
Example: CBandUserPeriod 1W
CBandUserPeriod 14D
CBandUserPeriod 60M

(23) Name: CBandUserPeriodSlice
Description: cband virtual users, the period stated period divided
Defaults: slice_len = limit
Context: <CBandUser>
Grammar: CBandUserPeriodSlice slice_length
Example: CBandUserLimit 100G
CBandUserPeriod 4W
CBandUserPeriodSlice 1W
Which is divided into four units per week (4W/1W = 4). Capacity of 100G / 4 = 25G
1 week, 25G, 2 weeks, this split is processed 50G.

7 Enough.
This is the latest version of the current mod_cband installation and operation, detailed description of the directive is the end of the course.
When first discovered, this module gippeotgo so too, has been tested by applying it.
In particular, it can extract the data to xml processing as it was very, very convenient.
Yet excesses in the domestic mod_cband course many people do not have

# # See the document
http://cband.linux.pl
http://www.howtoforge.com/mod_cband_apache2_bandwidth_quota_throttling

New! Click the words above to edit and view alternate translations.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>