Installation-安装(略) 官方网址:
[/url][url=http://cband.linux.pl/]http://cband.linux.plConfiguration Directives 配置说明New commands from 0.9.7.0 version - 0.9.7.0 版
新命令:
CBandDefaultExceededCode - the http code sent to the user when the quota is exceeded 当超出流量时,发送给用户的http代码
transfer speeds 传送速度:
kbps, Mbps, Gbps - multiples of "bits per second", respectively: 1024, 1024*1024 and 1024*1024*1024 bps 位/秒
kb/s, Mb/s, Gb/s - multiples of "bytes per second", respectively: 1024, 1024*1024 and 1024*1024*1024 b/s 字节/秒
defaults to
kbps 默认是
kbps transfer quotas 传送带宽:
K, M, G - multiples of bytes, respectively: 1000, 1000*1000 and 1000*1000*1000 bytes 字节
Ki, Mi, Gi - multiples of bytes, respectively: 1024, 1024*1024 and 1024*1024*1024 bytes 字节
defaults to
K 默认是K
time periods 时间周期:
S, M, H, D, W - multiples of seconds: Seconds, Minutes, Hours, Days, Weeks; respectively: 1, 60, 3600, 86400, 604800 seconds 秒、分、小时、天、周
defaults to
S 默认是秒
Name
CBandDefaultExceededURL Description
Default URL where mod_cband should redirect all requests to the virtualhost or user when the configured transfer limit is exceeded
NOTE: If you don't specify the exceeded URL location then standard 503 Service Unavailable will be sent
当超流量时,跳转的URL。
注意:如果没有配置此项,将发送503。
Context
Server config
Syntax
CBandDefaultExceededURL
URL Name
CBandDefaultExceededCode NEW
Description
The http code sent to the user when the configured transfer is exceeded
当流量超出时,发送给用户的http代码
Context
Server config
Syntax
CBandDefaultExceededCode
HTTP_CODE Example
CBandDefaultExceededCode 509
Name
CBandScoreFlushPeriod Description
Specifies a period after which the score for the virtualhost or user is written to the scoreboard file. Use this to improve mod_cband's performance
定义scoreboard文件写入的周期,用此提升mod_cband的性能。
Default
1
Context
Server config
Syntax
CBandScoreFlushPeriod
number_of_requestsExample
CBandScoreFlushPeriod 100
Any virtualhost's or user's scoreboard will be saved after 100 requests
所有虚拟主机和用的scoreboard写入周期是100次请求
Name
CBandSpeed Description
Specifies a maximal speed for a virtualhost
定义虚拟主机的最大带宽
Context
Syntax
CBandSpeed
kbps rps max_conn kbps - maximal transfer speed in [kMG]bps or [kMG]B/s
最大传送速度
rps - maximal requests per second
每秒最大请求数
max_conn - maximal number of simultaneous connections
最大连接数
Example
CBandSpeed 1024 10 30
Specifies maximal speed 1024kbps (1024 * 1024 bits per second), maximal 10 requests per second and with a maximum of 30 open connections
指定最大速度为1024kbps,每秒最大请求数10,最大连接数30
NOTE:This feature is available from version
0.9.6.0 注意:此功能在
0.9.6.0版以后支持
Name
CBandRemoteSpeed Description
Specifies maximal speed for any remote client
定义客户端的最大速度
Context
Syntax
CBandRemoteSpeed
kbps rps max_conn kbps - maximal transfer speed in [kMG]bps or [kMG]B/s
最大传送速度
rps - maximal requests per second
每秒最大请求数
max_conn - maximal number of simultaneous connections
最大连接数
Example
CBandRemoteSpeed 20kb/s 3 3
Specifies maximal speed 20kB/s (20 * 1024 bytes per second), maximal 3 requests per second and 3 open connections for any remote client
定义每客户端最大速度为20kB/s,每秒最大请求数为3,最大连接数为3
NOTE:This feature is available from version
0.9.6.1-rc2 注意:此功能在
0.9.6.1-rc2之后版本支持
Name
CBandClassRemoteSpeed Description
Specifies maximal speed for any remote client from some destination class
定义某类别网络中,客户端的最大速度
Context
Syntax
CBandClassRemoteSpeed
class_name kbps rps class_name - name of defined destination class
被定义的类名称
kbps - maximal transfer speed in kbps or kB/s
最大传送速度
rps - maximal requests per second
每秒最大请求数
max_conn - maximal number of simultaneous connections
最大连接数
Example
CBandClassDst 66.249.64/24
CBandClassDst 66.249.65/24
CBandClassDst 66.249.79/24
CBandClassRemoteSpeed googlebot_class 20kb/s 2 3
-Specifies maximal speed 20kB/s (20 * 1024 bytes per second), maximal 2 requests per second and 3 open connections for any remote client from class googlebot_class
-定义googlebot_class类中的客户端最大速度为20kB/s,每秒最大请求数为2,最大连接数为3
NOTE:This feature is available from version
0.9.6.1-rc2 注意:此功能在0.9.6.1-rc2版之后提供
Name
CBandRandomPulse Description
Turns On or Off the random pulse generator for data sending
r.p.g.开关
Random pulse generator is a part of the speed-limiting implementation of mod_cband. This directive changes the way a connection's speed is determined and enforced. The connections' speeds are measured within some time period and then provided for in that period. When r.p.g. is enabled this period is chosen randomly, providing for a statisticaly saner load distribution. Disabling this causes spikes both in bandwidth and cpu usages
r.p.g.是mod_cband速度限制的一种方式。它指定了连接检测采样的方式。打开此功能,将持续滚动采样。如果带宽和CPU占用不稳定的时候,关掉此功能。
Context
Global
Syntax
CBandRandomPulse
On/OffName
CBandLimit Description
Specifies bandwidth limit for virtualhost
限制虚拟主机的流量
Context
Syntax
CBandLimit
limitlimit - bandwidth quota size, available units:
K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)流量限制单位,可以用K、M、G、Ki、Mi、Gi
Example
CBandLimit 10M
Specifies 10 * 1000 * 1000 bytes bandwidth quota
限制流量为10M
CBandLimit 10Mi
Specifies 10 * 1024 * 1024 bytes bandwidth quota
限制流量为10Mi
IMPORTANT NOTE: the meaning of K, M and G changed with version 0.9.6.0. Check your config
重要提示:K、M和G的计量在0.9.6.0版后发生变化,检查你的配置。
Name
CBandClassLimit Description
Specifies bandwidth limit for virtualhost's destination class
定义虚拟主机目标类别的流量
Context
Syntax
CBandClassLimit
class_name limitclass_name - the name of defined class
类名称
limit - bandwidth quota size, available units:
K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)流量限制单位,可以用K、M、G、Ki、Mi、Gi
IMPORTANT NOTE: the meaning of K, M and G changed with version 0.9.6.0. Check your config
重要提示:K、M、G的衡量在0.9.6.0版后发生变化,检查你的配置。
Name
CBandExceededURL Description
Specifies a URL where mod_cband should redirect all requests to a virtualhost when the configured transfer limit is exceeded NOTE: If you don't specify the exceeded URL location then standard 503 Service Unavailable will be sent
指定当虚拟主机超出带宽或流量时,跳转的URL。提示:如果没有配置此项,将发送标准的503。
Context
Syntax
CBandExceededURL
URL Name
CBandExceededSpeed Description
Specifies maximal speed to which mod_cband slows down a virtualhost when the configured transfer limit is exceeded
定义当虚拟主机流量或带宽超出限制时,mod_cband将调节的最大速度
Context
Syntax
CBandExceededSpeed
kbps rps max_connkbps - maximal transfer speed in kbps or kB/s
最大传送速度,kbps或kB/s
rps - maximal requests per second
每秒最大请求数
max_conn - maximal number of simultaneous connections
最大连接数
NOTE:This feature is available from version
0.9.6.0 提示:此功能在0.9.6.0版以后提供
Name
CBandScoreboard Description
Specifies virtualhost's scoreboard file
指定虚拟主机的scoreboard文件按
Context
Syntax
CBandScoreboard
pathNOTE: The path must be writeable for the apache-user
提示:路径对于Apache用户必须可写
Name
CBandPeriod Description
Specifies a period after which a virtualhost's usages are cleared
定义虚拟主机使用情况清空的周期
Context
Syntax
CBandPeriod
periodperiod - available units:
S (seconds), M (minutes), H (hours), D (days), W (weeks)可用单位:S(秒)、M(分)、H(小时)、D(天)、W(周)
Example
CBandPeriod 1W
CBandPeriod 14D
CBandPeriod 60M
Name
CBandPeriodSlice Description
Specifies the period slice length
定义CBandPeriod周期内,分部分计算的时间长度
Default
slice_len = limit
Context
Syntax
CBandPeriodSlice
slice_lengthExample
CBandLimit 100G
CBandPeriod 4W
CBandPeriodSlice 1W
A period will be divided into 4 small slices (4W/1W = 4). Each slice has 100G/4=25G bandwidth limit. After 1W slice limit will be 50G, after 2W will be 75G ...
一个周期将被分成4个小部分(4周/1周=4)。每部分限制流量100G/4=25G。一周之后slice限制将是50G,两周后将是75G...
Name
Description
Define a new cband user
定义cband用户
Context
Server config
Syntax
user_name>
Name
CBandUserSpeed Description
Specifies maximal speed for a cband user
定义cband用户的最大带宽
Context
Syntax
CBandUserSpeed
kbps rps max_connkbps - maximal transfer speed in kbps or kB/s
最大速度
rps - maximal requests per second
每秒请求数
max_conn - maximal number of simultaneous connections
最大连接数
Example
CBandUserSpeed 100kb/s 10 5
Specifies maximal speed 100 kB/s (100 * 1024 bytes per second), maximal 10 requests per second and 5 open connections
定义用户的最大熟读为100kB/s,每秒最多10个请求,最大连接数为5
NOTE:This feature is available from version
0.9.6.0 提示:此功能在0.9.6.0以后提供
Name
CBandUserLimit Description
Specifies bandwidth limit for a cband user
指定cband user的流量
Context
Syntax
CBandUserLimit
limitlimit - bandwidth quota size, available units:
K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)流量可用单位K、M、G、Ki、Mi、Gi
Example
CBandUserLimit 10M
Specifies 10 * 1000 * 1000 bytes bandwidth quota
指定用户流量为10M
CBandUserLimit 10Mi
Specifies 10 * 1024 * 1024 bytes bandwidth quota
指定用户流量为10Mi
IMPORTANT NOTE: the meaning of K, M and G changed with version 0.9.6.0. Check your config
重要提示:K、M和G的计量在0.9.6.0版之后发生变化,检查你的配置。
Name
CBandUserClassLimit Description
Specifies bandwidth limit for a cband user's destination class
指定cband user类的流量
Context
Syntax
CBandUserClassLimit
class_name limitclass_name - the name of defined class
类名称
limit - bandwidth quota size, available units:
K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)流量大小单位,可用K、M、G、Ki、Mi、Gi
IMPORTANT NOTE: the meaning of K, M and G changed with version 0.9.6.0. Check your config
重要提示:在0.9.6.0版之后,K、M和G的计算方式发生变化,检查你的配置
Name
CBandUserExceededURL Description
Specifies a URL where mod_cband should redirect all requests to user's virtualhost when the configured transfer limit is exceeded
指定当cband user超出限制时,跳转的URL
NOTE: If you don't specify the exceeded URL location then standard 503 Service Unavailable will be sent
提示:如果没有定义此项,将发送标准的503
Context
Syntax
CBandUserExceededURL
URL Name
CBandUserExceededSpeed Description
Specifies maximal speed to which mod_cband slows down user when the configured transfer limit is exceeded
定义当cband user超出限制时,mod_cband将调节的速度
NOTE: CBandUserExceededURL must not be used if you want to only slow down user's pages with CBandUserExceededSpeed directive
提示:只有当CBandUserExceededURL没有设定时,此项才生效
Context
Syntax
CBandUserExceededSpeed
kbps rps max_connkbps - maximal transfer speed in kbps or kB/s
最大速度
rps - maximal requests per second
每秒请求数
max_conn - maximal number of simultaneous connections
最大连接数
NOTE:This feature is available from version
0.9.6.0 提示:从0.9.6.0版之后支持此功能
Name
CBandUserScoreboard Description
Specifies a user's scoreboard file
定义用户的scoreboard文件
Context
Syntax
CBandUserScoreboard
pathNOTE: The path must be writeable for the apache-user
提示:目录必须允许apache用户写入
Name
CBandUserPeriod Description
Specifies a period after which a user's usages are cleared
定义cband user计算周期
Context
Syntax
CBandUserPeriod
periodperiod - available units:
S (seconds), M (minutes), H (hours), D (days), W (weeks)可用单位S(秒)、M(分)、H(小时)、D(天)、W(周)
Example
CBandUserPeriod 1W
CBandUserPeriod 14D
CBandUserPeriod 60M
Name
CBandUserPeriodSlice Description
Specifies a period slice length
定义CBandUserPeriod的分割
Default
slice_len = limit
Context
Syntax
CBandUserPeriodSlice
slice_lengthExample
CBandUserLimit 100G
CBandUserPeriod 4W
CBandUserPeriodSlice 1W
A period will be divided into 4 small slices (4W/1W = 4). Each slice has 100G/4=25G bandwidth limit. After 1W slice limit will be 50G, after 2W will be 75G ...
CBandUserPeriod将被分割成4个部分(4W/1W=4)。每部分限制流量100G/4=25G。一周之后部分限制将为50G,两周后为75G...
Status Handler Configuration Example
状态配置实例

To view actual bandwidth limits, usages, users, scoreboards, add the following lines into the config file:
要观察时势的流量、使用、用户、scoreboard,添加以下内容到配置文件:
SetHandler cband-status
SetHandler cband-status-me
Then you can access the status page with a URL like:
这样,你就可以通过以下地址来访问
[/url][url=http://server_name/cband-status]http://server_name/cband-status[/url][url=http://server_name/cband-status-me]http://server_name/cband-status-me在0.9.5-rc1之后的版本中,可以通过XML格式来观察[/url][url=http://server_name/cband-status?xml]http://server_name/cband-status?xml[/url][url=http://server_name/cband-status-me?xml]http://server_name/cband-status-me?xmlBandwidth Speed Configuration Example
流量带宽配置实例
DocumentRoot /var/www/xyz.org/
ServerName xyz.org
CustomLog /var/log/apache2/xyz.org.access combined
ErrorLog /var/log/apache2/xyz.org.access.error
RewriteEngine On
RewriteOptions inherit
# Maximal 1024kbps speed for this virtualhost
# 最大带宽1024kbps
# Maximal 10 requests per second for this virtualhost
# 每秒最多10个请求
# Maximal 30 open connections for this virtualhost
# 最大连接为30个
CBandSpeed 1024 10 30
# Maximal 10kB/s speed, 3 requests/s and 2 open connections for any remote client
# 每个远程客户端最大带宽10kB/s,每秒最多3个请求,最大连接为2个
CBandRemoteSpeed 10kb/s 3 2
# Maximal 20kB/s speed, 2 requests/s and 3 open connections for remote
# clients from class googlebot_class :P
# 对于googlebot_class类的远程用户,最大带宽为20kB/s,每秒最多2个请求,最大连接为3个
CBandClassRemoteSpeed googlebot_class 20kb/s 2 3
Bandwidth Quota Configuration Example
流量限制配置实例per-virtualhost bandwidth limiting configuration
每虚拟主机流量配置Next, you may define virtualhost's bandwidth limits, URL location and the path to scoreboard files for individual virtualhosts:
下面,你可以订制虚拟主机的流量限制、URL和scoreboard文件
# specify default 'bandwidth exceeded' location
# 定义超出流量之后跳转的URL
CBandDefaultExceededURL
[/url][url=http://haha.org/bandwidth_exceeded.html]http://haha.org/bandwidth_exceeded.html
DocumentRoot /var/www/xyz.org/
ServerName xyz.org
CustomLog /var/log/apache2/xyz.org.access combined
ErrorLog /var/log/apache2/xyz.org.access.error
RewriteEngine On
RewriteOptions inherit
# 100MB virtualhost bandwidth limit
# 流量限制为100M
CBandLimit 100000
# redirect to
[/url][url=http://abc.org/bandwidth_exceeded.html]http://abc.org/bandwidth_exceeded.html # when the limit has been reached
# 当超过流量时,跳转URL到
[/url][url=http://abc.org/bandwidth_exceeded.html]http://abc.org/bandwidth_exceeded.html CBandExceededURL [/url][url=http://abc.org/bandwidth_exceeded.html]http://abc.org/bandwidth_exceeded.html
# virtualhost's scoreboard file
# 虚拟主机的scoreboard文件
CBandScoreboard /var/run/apache2/xyz.org.scoreboard
# a period of time after which the scoreboard will be cleared (30 minutes)
# (only in >=0.9.5-rc2)
# scoreboard清空周期(30分钟),仅在0.9.5-rc2之后版本支持
CBandPeriod 30M
per-user bandwidth limiting configuration (only in versions >=0.9.1)
按用户指定流量
(仅限0.9.1之后版本)In versions >=0.9.1 you can define limits for users and assign virtualhosts to them
在0.9.1版之后,你可以指定用户限制然后将虚拟主机分配给用户
--------------------------------------------------------------------------------
# define user‘dembol’
# 定义用户‘dembol’
# 200MB bandwidth limit for user ‘dembol’
# 限制用户流量为200MB
CBandUserLimit 200000
# redirect to
[/url][url=http://abc.org/bandwidth_exceeded.html]http://abc.org/bandwidth_exceeded.html # when the limit has been reached
# 如果用户超出限制,跳转到URL
[/url][url=http://abc.org/bandwidth_exceeded.html]http://abc.org/bandwidth_exceeded.html CBandUserExceededURL
[/url][url=http://abc.org/bandwidth_exceeded.html]http://abc.org/bandwidth_exceeded.html # user's scoreboard file
# 用户的scoreboard文件
CBandUserScoreboard /var/run/apache2/dembol.scoreboard
# a period of time after which the scoreboard will be cleared (5 weeks)
# (only in >=0.9.5-rc2)
# 清空scoreboard的周期
CBandUserPeriod 5W
--------------------------------------------------------------------------------
# assign virtualhost ‘xyz.org’ to user ‘dembol’
# 将虚拟主机‘xyz.org’分配给‘dembol’用户
ServerName xyz.org
# Specify virtualhost's owner
# 指定虚拟主机的所有者
CBandUser dembol
# assign virtualhost ‘aga.org’ to user ‘dembol’
# 将虚拟主机‘aga.org’分配给‘dembol’用户
ServerName aga.org
# Specify virtualhost's owner
# 指定虚拟主机的所有者
CBandUser dembol
per-user and per-virtualhost bandwidth limiting configuration (only in versions >=0.9.1)
按用户和虚拟主机混合方式指定流量和带宽(仅限于0.9.1之后版本)In versions >=0.9.1 you can also mix per-user and per-virtualhost bandwidth limiting techniques
在0.9.1版之后,你可以混合用户和虚拟主机方式来指定流量和带宽
--------------------------------------------------------------------------------
# define user "dembol"
# 定义用户 “dembol”
# 200MB bandwidth limit for user "dembol"
# “dembol”用户流量限制为200MB
CBandUserLimit 200000
# redirect to
[/url][url=http://abc.org/bandwidth_exceeded.html]http://abc.org/bandwidth_exceeded.html # when the limit has been reached
# 如果超出限制,跳转到URL
[/url][url=http://abc.org/bandwidth_exceeded.html]http://abc.org/bandwidth_exceeded.html CBandUserExceededURL
[/url][url=http://abc.org/bandwidth_exceeded.html]http://abc.org/bandwidth_exceeded.html # user's scoreboard file
# 用户的scoreboard文件
CBandUserScoreboard /var/run/apache2/dembol.scoreboard
# a period of time after which the scoreboard will be cleared (4 days)
# (only in >=0.9.5-rc2)
# 清空scoreboard的周期(4天)
CBandUserPeriod 4D
--------------------------------------------------------------------------------
# assign virtualhost "xyz.org" to user "dembol"
# 将虚拟主机“xyz.org”分配给用户“dembol”
ServerName xyz.org
# Specify virtualhost's owner
# 指定虚拟主机的所有者
CBandUser dembol
# 100MB virtualhost bandwidth limit
# 限制此虚拟主机流量为100MB
CBandLimit 100000
# redirect to
[/url][url=http://abc.org/bandwidth_exceeded.html]http://abc.org/bandwidth_exceeded.html # when the limit has been reached
# 如果超出限制,跳转到URL
[/url][url=http://abc.org/bandwidth_exceeded.html]http://abc.org/bandwidth_exceeded.html CBandExceededURL
[/url][url=http://abc.org/bandwidth_exceeded.html]http://abc.org/bandwidth_exceeded.html # virtualhost's scoreboard file
# 虚拟主机的scoreboard文件
CBandScoreboard /var/run/apache2/xyz.org.scoreboard
# a period of time after which the scoreboard will be cleared (50 minutes)
# (only in >=0.9.5-rc2)
# 清空scoreboard的周期(50分钟)
CBandPeriod 50M
# assign virtualhost "aga.org" to user "dembol"
# 将虚拟主机“aga.org”分配给用户“dembol”
ServerName aga.org
# Specify virtualhost's owner
# 指定虚拟主机的所有者
CBandUser dembol
per-destination bandwidth limiting configuration (only in >=0.9.5-rc1 versions)
按远程目标指定流量和带宽(仅限0.9.5-rc1之后版本)In >= 0.9.5-rc1 you can limit traffic to some destination classes. The destination classes are defined by section. The limits for the classes are specified by CBandClassLimit and CBandUserClassLimit commands
在0.9.5-rc1之后,你可以通过来定义远程目标类来指定类的流量和带宽。同时也可以定义CBandClassLimit和CBandUserClassLimit来定义不同的类
# define "class_1"
# 定义 "class_1"
CBandClassDst 217.172.231.67
CBandClassDst 127/8
CBandClassDst 192.168.0.0/24
CBandClassDst 10.0.0.20
# define "class_2"
# 定义"class_2"
CBandClassDst 192.168.100.100
CBandClassDst 153.19/16
CBandUserLimit 1000000
CBandUserExceededURL
[/url][url=http://edns.pl/bandwidth_exceeded.html]http://edns.pl/bandwidth_exceeded.html CBandUserScoreboard /home/dembol/write/user.dembol.scoreboard
# 500MB limit for "class_2"
# "class_2"限制流量500MB
CBandUserClassLimit class_2 500000
CBandUser dembol
# 1GB limit for "class_1"
# "class_1"限制流量1GB
CBandClassLimit class_1 1000000
# a period of time after which the scoreboard will be cleared (120 seconds)
# (only in >=0.9.5-rc2)
# 定义scoreboard的清空时间为120秒(仅限0.9.5-rc2以上版本)
CBandPeriod 120S
Configuration file example
配置文件实例
# 可以通过
[/url][url=http://yourdomain/cband-status]http://yourdomain/cband-status查看流量
SetHandler cband-status
# 超出限制,跳转到google
CBandDefaultExceededURL
[/url][url=http://www.google.com/]http://www.google.com # 定义类别
CBandClassDst 217.172.231.67
CBandClassDst 127/8
CBandClassDst 192.168.0.0/24
CBandClassDst 10.0.0.20
CBandClassDst 192.168.100.100
CBandClassDst 153.19/16
CBandClassDst 10.13/16
# 定义用户
CBandUserLimit 100000
CBandUserExceededURL
http://server_name.com/bandwidth_exceeded.html CBandUserScoreboard /home/dembol/write/user.dembol.scoreboard
CBandUserPeriod 10W
CBandUserLimit 1000000
CBandUserExceededURL
[/url][url=http://server_name.com/bandwidth_exceeded.html]http://server_name.com/bandwidth_exceeded.html CBandUserScoreboard /home/dembol/write/user.dembolek.scoreboard
CBandUserClassLimit class_1 50000
CBandUserPeriod 20H
CBandUserLimit 10000000
CBandUserExceededURL
[/url][url=http://www.google.com/]http://www.google.com CBandUserScoreboard /home/dembol/write/user.dembol.nasa.pl.scoreboard
CBandUserClassLimit class_2 3000
CBandUserClassLimit class_3 10000
CBandUserPeriod 2H
NameVirtualHost *:80
DocumentRoot /home/dembol/public_html/dembol.nasa.pl/
ServerName dembol.nasa.pl
ServerAlias *.dembol.nasa.pl
Setenv VLOG /home/dembol/public_html/logs/dembol.nasa.pl.access
CustomLog /home/dembol/public_html/logs/dembol.nasa.pl.access combined
ErrorLog /home/dembol/public_html/logs/dembol.nasa.pl.error
# 设定虚拟主机的cband
CBandLimit 100000000
CBandUser dembol.nasa.pl
CBandExceededURL
[/url][url=http://edns.pl/bandwidth_exceeded.html]http://edns.pl/bandwidth_exceeded.html CBandScoreboard /home/dembol/write/dembol.nasa.pl.scoreboard
CBandClassLimit class_1 10000000
CBandPeriod 200S
DocumentRoot /home/dembol/public_html/dembol.nasa.pl/
ServerName dembol.eu.orgServerAlias *.dembol.eu.org
Setenv VLOG /home/dembol/public_html/logs/dembol.eu.org.access
CustomLog /home/dembol/public_html/logs/dembol.eu.org.access combined
ErrorLog /home/dembol/public_html/logs/dembol.eu.org.error
# 设定虚拟主机的cband
CBandUser dembolek
CBandLimit 10000
CBandExceededURL
[/url][url=http://server_name.com/bandwidth_exceeded.html]http://server_name.com/bandwidth_exceeded.html CBandScoreboard /home/dembolek/write/dembol.eu.org.scoreboard
CBandClassLimit class_1 700000
CBandClassLimit class_2 100000
CBandClassLimit class_3 500000
CBandPeriod 5D
DocumentRoot /home/dembol/public_html/dembol.nasa.pl/cvs_alias
ServerName cvs.cband.linux.pl:80
Setenv VLOG /home/dembol/public_html/logs/cvs.cband.linux.pl.access
CustomLog /home/dembol/public_html/logs/cvs.cband.linux.pl.access combined
ErrorLog /home/dembol/public_html/logs/cvs.cband.linux.pl.error
# 设定虚拟主机的cband
CBandUser dembol
CBandLimit 100000
CBandExceededURL
[/url][url=http://server_name.com/bandwidth_exceeded.html]http://server_name.com/bandwidth_exceeded.html CBandScoreboard /home/dembol/write/dembol.eu.org.scoreboard
CBandClassLimit class_3 20000
CBandPeriod 1W
Performance Tests
性能测试mod_cband without
CBandScoreFlushPeriod directive
mod_cband 不清空score
MPM preforkMPM workerMPM perchildMPM eventMPM leaderwith mod_cband316.63 rps346.89 rps~297.36 rps~without mod_cband447.76 rps406.91 rps~425.13 rps~mod_cband with
CBandScoreFlushPeriod 100 directive
mod_cband 设定清空score周期为100
MPM preforkMPM workerMPM perchildMPM eventMPM leaderwith mod_cband405.17 rps365.22 rps~414.60 rps~without mod_cband447.76 rps406.91 rps~425.13 rps~Http server:
Apache 2.2, default http.conf, compiled with:
Apache2.2版,默认的http.conf配置,按以下方式编译
./configure --with-mpm=$1 \
--enable-layout=Slackware \
--enable-v4-mapped \
--enable-cache \
--enable-disk-cache --enable-mem-cache \
--enable-deflate \
--enable-ssl \
--enable-mods-shared=all \
--with-uid=apache --with-gid=apache \
--with-gdbm --with-berkeley-db
Linux kernel: 2.6.14.2-grsec
Linux 内核版本:2.6.14.2-grsec
Machine: 2xPentium II 333MHz, 320MB RAM
机器配置:双PII 333MHz,320MB内存
Network: 100Mbps ethernet
网络:100Mbps以太网
Test command:
测试使用命令
httperf --server 192.168.0.25 --port 8 --num-conns 1000 --uri
http://www.traktor.pl --hog