常见问题常见问题   搜索搜索   会员列表会员列表   团队团队   注册注册    个人资料个人资料   登录查看您的站内信件登录查看您的站内信件   登录登录 

使用mod_cband管理Apache 2带宽和流量(原创)
前往页面 1, 2  下一页
 
发表新文章   这个论题已经被锁定,您不能发表、回复或者编辑文章。    FreeBSD China -> 安装-配置-优化-安全
阅读上一个主题 :: 阅读下一个主题  
作者 留言
50g
道童


注册时间: 2003-08-21
文章: 260

文章发表于: Fri 2006-06-30 21:14:30    发表主题: 使用mod_cband管理Apache 2带宽和流量(原创) 引用并回复

mod_cband是一个通过Apache 2模块来解决限制用户和虚拟主机带宽问题的应用,当前版本可以调整虚拟主机和用户带宽限额,最高下载速度(like in mod_bandwidth),每秒访问请求速度和最高并发访问ip连接数(like in mod_limitipconn)。
"我告诉主机服务提供商使用mod_cband,想要限制他们用户数据传输,像“每月10 Gb流量”这样。但已有了mod_curb模块,可以限制流量,但无法工作在虚拟主机和Apache 2下,所以我写了自己的模块完全适合于Apache 2 API同时支持每用户和每虚拟主机带宽限制。"(此段翻译自官方网站)

FreeBSD ports path and pkg-descr info
/usr/ports/www/mod_cband
mod_cband is an Apache 2 module provided to solve the problem of limiting virtualhosts bandwidth usage. When the configured virtualhost’s transfer limit is exceeded, mod_cband will redirect all further requests to a location specified in the configuration file.

好了,说道这里我想这个模块的精髓之处在于完美的支持Apache 2并实现了原有两个模块的全部功能(2in1)且支持每用户和每虚拟主机带宽限制。这在进行web平台应用与整合之时给我们提供了又一易用的方法。准备动手吧!文中实例与系统平台均基于freebsd6.1平台。

提示:
在进行实际操作之前请确保你的ports tree已经同步到当前版本。具体方法请参考http://cnsnap.cn.freebsd.org/doc ... ok/ports-using.html,关于freebsd和apache2的安装本文不予介绍,同时假定你已经安装并配置了所需环境。

安装:
#cd /usr/ports/www/mod_cband
#make install clean
安装结束后末尾输出:
chmod 755 /usr/local/libexec/apache2/mod_cband.so
[activating module `cband’ in /usr/local/etc/apache2/httpd.conf]
===> Registering installation for mod_cband-0.9.7.3
此时cband_module已经自动添加到你的httpd.conf文件中并开启了。
LoadModule cband_module libexec/apache2/mod_cband.so
至此mod_cband安装已经完成,让我们继续后面的操作。之前说mod_cband易用是相对的,主要是看你如何配置让他为你所用。一些基础配置还是很容易完成,但是要发挥它的强大和灵活配置还是要好好看看documentation,充分理解良好驾驭。不��嗦了,下面看看如何进行基本配置和使用并观测实际效果。以我这个blog为实例,看看基本情况:
<VirtualHost *:80>
DocumentRoot “/other/blog/wordpress”
ServerName blog.citygrit.cn
<Directory “/other/blog/wordpress”>
allow from all
Options +Indexes
</Directory>
# 100MB virtualhost bandwidth limit
CBandLimit 100M
# Maximal 1024kbps speed for this virtualhost
# Maximal 10 requests per second for this virtualhost
# Maximal 30 open connections for this virtualhost
CBandSpeed 1024 10 30
# Maximal 10kB/s speed, 3 requests/s and 2 open connections for any remote client
CBandRemoteSpeed 10kb/s 3 2
# a period of time after which the scoreboard will be cleared (4 weeks)
CBandPeriod 4W
#Then you can access the status page with a URL like:http://server_name/cband-status
<Location /cband-status>
SetHandler cband-status
</Location>
#Then you can access the status page with a URL like:http://server_name/cband-status-me
<Location /cband-status-me>
SetHandler cband-status-me
</Location>
</VirtualHost>
为了便于理解将上面内容里与mod_cband相关设置予以说明,(约定“#”为注释标记)。
# 100MB virtualhost bandwidth limit
CBandLimit 100M
限制虚拟主机总访问带宽为100Mb。
# Maximal 1024kbps speed for this virtualhost
# Maximal 10 requests per second for this virtualhost
# Maximal 30 open connections for this virtualhost
CBandSpeed 1024 10 30
限制此虚拟主机最高访问速度1024kbps
限制此虚拟主机每秒最高接受请求数10个
限制此虚拟主机最高并发连接30个
# Maximal 10kB/s speed, 3 requests/s and 2 open connections for any remote client
CBandRemoteSpeed 10kb/s 3 2
限制来自远端访问速度10kB每秒,3个请求每秒,2个连接。
# a period of time after which the scoreboard will be cleared (4 weeks)
CBandPeriod 4W
设定多久对所记录的全局访问带宽进行重设(清零)。
4W=4 weeks 4周(一个月)
#Then you can access the status page with a URL like:http://server_name/cband-status
<Location /cband-status>
SetHandler cband-status
</Location>
开启了mod_cband的实时监测功能,可以通过http://server_name/cband-status进行直观的观测。(全局监测)
#Then you can access the status page with a URL like:http://server_name/cband-status-me
<Location /cband-status-me>
SetHandler cband-status-me
</Location>
开启了mod_cband的实时监测功能,可以通过http://server_name/cband-status-me进行直观的观测。(单一监测)

通过上文简单介绍了mod_cband在freebsd平台下与apache2进行整合及基本配置,整个过程属于理论结合实际操作并得以真实应用,保证其可实施性但不承诺由于其他原因造成的配置与使用问题。如果希望详细了解mod_cband的更加强大的功能和高级配置请访问其网站。本文中部分实例参考了官方网站和Manage Apache Download Speed And Traffic Limits With mod_cband这里的文章。

通告:本文系作者原创,并未抄袭互联网及其他已发表的类似文章。文中所引用
系官方网站实例及说明。欢迎转载但请注明出处已示对作者劳动成果的尊重,谢谢。如果您发现文中的表述有误请联络我,我会及时做出修正。(但不包括由于系统平台及应用软件发生变化而产生的问题)

原文链接:http://blog.citygrit.cn/?p=13
Citygrit citygrit#gmail.com


最后进行编辑的是 50g on Sat 2006-07-01 00:26:09, 总计第 3 次编辑
返回页首
阅览会员资料 发送站内信件 浏览发表者的主页
antijp
老妖


注册时间: 2004-10-16
文章: 2745

文章发表于: Fri 2006-06-30 23:26:31    发表主题: 引用并回复

文不错,但是能不能把中英文重复的部分修改一下?
返回页首
阅览会员资料 发送站内信件
xpzzh
半仙


注册时间: 2005-10-25
文章: 14

文章发表于: Tue 2006-08-08 04:00:18    发表主题: 引用并回复

楼主你好,我在测试过程中按照您写的不能成功,我装的是6.1,通过ports安装的mod_cband,但是查看的信息提示mod_cband的版本是0.9.5.3的,命令均不能运行的啊,启动apache2的时候就提示错误了,请问我在什么地方有错呢?
返回页首
阅览会员资料 发送站内信件
50g
道童


注册时间: 2003-08-21
文章: 260

文章发表于: Tue 2006-08-08 14:48:46    发表主题: re 引用并回复

"在进行实际操作之前请确保你的ports tree已经同步到当前版本。具体方法请参考http://cnsnap.cn.freebsd.org/doc/zh_CN.GB2312/books/handbook/ports-using.html,关于freebsd和apache2的安装本文不予介绍,同时假定你已经安装并配置了所需环境。"

"如果您发现文中的表述有误请联络我,我会及时做出修正。(但不包括由于系统平台及应用软件发生变化而产生的问题)"

"我装的是6.1,通过ports安装的mod_cband,但是查看的信息提示mod_cband的版本是0.9.5.3的,命令均不能运行的啊,启动apache2的时候就提示错误了,请问我在什么地方有错呢?"

请确认你的运行环境与本文所述为1:1环境,如果所使用软件的版本与本文相对应,请帖出错误信息。
返回页首
阅览会员资料 发送站内信件 浏览发表者的主页
xpzzh
半仙


注册时间: 2005-10-25
文章: 14

文章发表于: Tue 2006-08-08 21:07:12    发表主题: 引用并回复

偶错了,谢谢指点.
返回页首
阅览会员资料 发送站内信件
sylion
半仙


注册时间: 2006-05-10
文章: 43

文章发表于: Thu 2006-08-17 14:02:40    发表主题: 引用并回复

这几天安装了这个东西,目前的port版本mod_cband-0.9.7.3有bug,就是修改了conf中的配置,重新启动apache,新参数不起作用。
去了作者网站,看到说新版的mod_cband-0.9.7.4已经修正了这个bug。

还有要注意的是,对于带宽的缺省单位kbps,是1024bit/s。这个很容易搞错。
如果你想让客户端下载速度为30kb/s,那客户端的设定是:
CBandRemoteSpeed 240 3 3
返回页首
阅览会员资料 发送站内信件
50g
道童


注册时间: 2003-08-21
文章: 260

文章发表于: Thu 2006-08-17 15:09:35    发表主题: re 引用并回复

感谢楼上兄弟的提示与补充!
返回页首
阅览会员资料 发送站内信件 浏览发表者的主页
50g
道童


注册时间: 2003-08-21
文章: 260

文章发表于: Thu 2006-08-17 16:05:55    发表主题: re 引用并回复

"还有要注意的是,对于带宽的缺省单位kbps,是1024bit/s。这个很容易搞错。
如果你想让客户端下载速度为30kb/s,那客户端的设定是:
CBandRemoteSpeed 240 3 3"

这里应该可以使用kb/s来声明速度计量单位吧?
# Maximal 10kB/s speed, 3 requests/s and 2 open connections for any remote client
CBandRemoteSpeed 10kb/s 3 2
返回页首
阅览会员资料 发送站内信件 浏览发表者的主页
yzz163
半仙


注册时间: 2004-12-03
文章: 160

文章发表于: Fri 2006-08-18 10:47:26    发表主题: 引用并回复

#cvsup -g -L 2 /etc/ports-stable
#cd /usr/ports/www/mod_cband
#make install

安装都正常,APACHE 2.2.3,httpd.conf 里有LoadModule cband_module libexec/apache22/mod_cband.so。就是不能运行。

#/usr/local/etc/rc.d/apache22.sh configtest
就报错:

Performing sanity check on apache22 configuration:
Bad system call (core dumped)

如何解决?apache2.2.3需要特别的编译选项吗?我是ports默认安装的。
返回页首
阅览会员资料 发送站内信件
sylion
半仙


注册时间: 2006-05-10
文章: 43

文章发表于: Fri 2006-08-18 12:52:07    发表主题: Re: re 引用并回复

50g 写到:


这里应该可以使用kb/s来声明速度计量单位吧?
# Maximal 10kB/s speed, 3 requests/s and 2 open connections for any remote client
CBandRemoteSpeed 10kb/s 3 2

我只是提醒不要把缺省的速度单位kbps理解为kb/s。当然指定上kb/s也是可以的。


楼上,我是在apache 2.0.58上安装的,没有你说的问题。
返回页首
阅览会员资料 发送站内信件
yzz163
半仙


注册时间: 2004-12-03
文章: 160

文章发表于: Fri 2006-08-18 16:11:08    发表主题: 引用并回复

提示:
在进行实际操作之前请确保你的ports tree已经同步到当前版本。
---------------------------

不知楼主,用的哪版APACHE?用ports, make install就行吗?还需要其他参数吗?
返回页首
阅览会员资料 发送站内信件
yzz163
半仙


注册时间: 2004-12-03
文章: 160

文章发表于: Fri 2006-08-18 16:13:56    发表主题: 引用并回复

另外能说说如何编译:mod-cband-0.9.7.4.tgz的吗?
返回页首
阅览会员资料 发送站内信件
sylion
半仙


注册时间: 2006-05-10
文章: 43

文章发表于: Fri 2006-08-18 18:51:56    发表主题: 引用并回复

yzz163 写到:
另外能说说如何编译:mod-cband-0.9.7.4.tgz的吗?

我是下载的源代码包安装的。
先把0.9.7.3卸掉:
cd /usr/ports/www/mod_cband
make deinstall

然后下载源代码包,放到你工作目录里面:
tar zvxf mod-cband-0.9.7.4.gz
cd mod-cband-0.9.7.4
./configure
make
make install
返回页首
阅览会员资料 发送站内信件
yzz163
半仙


注册时间: 2004-12-03
文章: 160

文章发表于: Fri 2006-08-18 20:13:09    发表主题: 引用并回复

装了APACHE2.0.59 还是不行,同样Bad system call (core dumped)。
只有用mod_limitipconn2没问题。
返回页首
阅览会员资料 发送站内信件
yzz163
半仙


注册时间: 2004-12-03
文章: 160

文章发表于: Fri 2006-08-18 20:18:04    发表主题: 引用并回复

我的机器用mod_limitipconn2,在APACHE2.0 /2.2.3上都正常。用mod_cband,mod_bw都不行。可能我的机器上没装apxs的一些共享库文件?
返回页首
阅览会员资料 发送站内信件
50g
道童


注册时间: 2003-08-21
文章: 260

文章发表于: Mon 2006-08-21 16:49:56    发表主题: re 引用并回复

最初apache版本是2.0.58,目前apache版本2.0.59,前些时候使用portupgrade升级的,make时使用参数WITH_MPM=worker WITH_THREADS=yes WITHOUT_IPV6=yes,不过加不加参数应该与mod_cband无关。目前使用的mod_cband还是ports当中的0.9.7.3。至于反应的的重启apache无法生效新的配置,官方网站的bug系统倒是有人反应http://sourceforge.net/tracker/index.php?func=detail&aid=1495526&group_id=154335&atid=791368(CBandSpeed not changed after apache graceful),楼上的一位弟兄已经说明在0.9.7.4版本中修复了这个问题,我倒是没有遇到,平时都用apachectl restart,当然有人反应说明确有此问题。下面是新版cband的修正注记:
28-05-2006 Lukasz Dembinski <dembol@cband.linux.pl>
* FIXED BUG: the module doesn't set normal speed after refresh period. The speed is still the same as it was set by CBandExceededSpeed and isn't set to the normal speed after refresh period
(thanks to Pawe?Kustro?<pawel.kustron@goin.pl>)
* Fixed small bugs in documentation
至于yzz163所出现的情况我只能表示遗憾,我和sylion的实际应用中没有你描述的问题出现,这个只有靠你自己排查了,抱歉。
返回页首
阅览会员资料 发送站内信件 浏览发表者的主页
fxj
半仙


注册时间: 2005-11-20
文章: 147

文章发表于: Tue 2006-10-24 23:10:28    发表主题: 引用并回复

经过几天的不停的测试。证实。在apache2.2.3下不做修改是用不起来的。容易导致系统死机(服务器上没有任何的响应)。

返回到2.0后一切都好。没有任何问题。
返回页首
阅览会员资料 发送站内信件
yzz163
半仙


注册时间: 2004-12-03
文章: 160

文章发表于: Wed 2006-10-25 11:17:37    发表主题: 引用并回复

在apache2.2.3下不做修改
---------------------

如何修改?

_________________
====
返回页首
阅览会员资料 发送站内信件
上岸的鱼
半仙


注册时间: 2005-09-15
文章: 2

文章发表于: Sun 2006-11-05 13:00:17    发表主题: 选项 引用并回复

Documentation
Tutorials
Manage Apache Download Speed And Traffic Limits With mod_cband - New!!
mod_cband FAQ by Adam Dawidowski
ISPConfig and BandWidth control (also in Spanish) by Erik Corona
Configuration
Configuration is very simple, you must write only several lines. First, you must add the following command to the main config file to load the mod_cband module:
LoadModule cband_module modules/mod_cband.so

Configuration Directives
New commands from 0.9.7.0 version:

CBandDefaultExceededCode - the http code sent to the user when the quota is exceeded

Units accepted in various directives:

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


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


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
Context Server config
Syntax CBandDefaultExceededURL URL
Name CBandDefaultExceededCode NEW
Description The http code sent to the user when the configured transfer is exceeded

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
Default 1
Context Server config
Syntax CBandScoreFlushPeriod number_of_requests


Example CBandScoreFlushPeriod 100

Any virtualhost's or user's scoreboard will be saved after 100 requests
Name CBandSpeed
Description Specifies a maximal speed for a virtualhost
Context <Virtualhost>
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

NOTE:This feature is available from version 0.9.6.0
Name CBandRemoteSpeed
Description Specifies maximal speed for any remote client
Context <Virtualhost>
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

NOTE:This feature is available from version 0.9.6.1-rc2
Name CBandClassRemoteSpeed
Description Specifies maximal speed for any remote client from some destination class
Context <Virtualhost>
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 <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

-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

NOTE:This feature is available from version 0.9.6.1-rc2
Name CBandRandomPulse
Description Turns On or Off the random pulse generator for data sending
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
Context Global
Syntax CBandRandomPulse On/Off


Name CBandLimit
Description Specifies bandwidth limit for virtualhost
Context <Virtualhost>
Syntax CBandLimit limit

limit - bandwidth quota size, available units: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)


Example CBandLimit 10M
Specifies 10 * 1000 * 1000 bytes bandwidth quota

CBandLimit 10Mi
Specifies 10 * 1024 * 1024 bytes bandwidth quota

IMPORTANT NOTE: the meaning of K, M and G changed with version 0.9.6.0. Check your config
Name CBandClassLimit
Description Specifies bandwidth limit for virtualhost's destination class
Context <Virtualhost>
Syntax CBandClassLimit class_name limit

class_name - the name of defined class
limit - bandwidth quota size, available units: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)

IMPORTANT NOTE: the meaning of K, M and G changed with version 0.9.6.0. Check your config
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
Context <Virtualhost>
Syntax CBandExceededURL URL
Name CBandExceededSpeed
Description Specifies maximal speed to which mod_cband slows down a virtualhost when the configured transfer limit is exceeded
Context <Virtualhost>
Syntax CBandExceededSpeed kbps rps max_conn

kbps - 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
Name CBandScoreboard
Description Specifies virtualhost's scoreboard file
Context <Virtualhost>
Syntax CBandScoreboard path

NOTE: The path must be writeable for the apache-user
Name CBandPeriod
Description Specifies a period after which a virtualhost's usages are cleared
Context <Virtualhost>
Syntax CBandPeriod period

period - available units: S (seconds), M (minutes), H (hours), D (days), W (weeks)


Example CBandPeriod 1W
CBandPeriod 14D
CBandPeriod 60M

Name CBandPeriodSlice
Description Specifies the period slice length
Default slice_len = limit
Context <Virtualhost>
Syntax CBandPeriodSlice slice_length


Example 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 ...
Name <CBandUser>
Description Define a new cband user
Context Server config
Syntax <CBandUser user_name>
Name CBandUserSpeed
Description Specifies maximal speed for a cband user
Context <CBandUser>
Syntax CBandUserSpeed kbps rps max_conn

kbps - 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

NOTE:This feature is available from version 0.9.6.0
Name CBandUserLimit
Description Specifies bandwidth limit for a cband user
Context <CBandUser>
Syntax CBandUserLimit limit

limit - bandwidth quota size, available units: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)


Example CBandUserLimit 10M
Specifies 10 * 1000 * 1000 bytes bandwidth quota

CBandUserLimit 10Mi
Specifies 10 * 1024 * 1024 bytes bandwidth quota

IMPORTANT NOTE: the meaning of K, M and G changed with version 0.9.6.0. Check your config
Name CBandUserClassLimit
Description Specifies bandwidth limit for a cband user's destination class
Context <CBandUser>
Syntax CBandUserClassLimit class_name limit

class_name - the name of defined class
limit - bandwidth quota size, available units: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi)

IMPORTANT NOTE: the meaning of K, M and G changed with version 0.9.6.0. Check your config
Name CBandUserExceededURL
Description Specifies a URL where mod_cband should redirect all requests to user's 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
Context <CBandUser>
Syntax CBandUserExceededURL URL
Name CBandUserExceededSpeed
Description Specifies maximal speed to which mod_cband slows down user when the configured transfer limit is exceeded

NOTE: CBandUserExceededURL must not be used if you want to only slow down user's pages with CBandUserExceededSpeed directive


Context <CBandUser>
Syntax CBandUserExceededSpeed kbps rps max_conn

kbps - 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
Name CBandUserScoreboard
Description Specifies a user's scoreboard file
Context <CBandUser>
Syntax CBandUserScoreboard path

NOTE: The path must be writeable for the apache-user
Name CBandUserPeriod
Description Specifies a period after which a user's usages are cleared
Context <CBandUser>
Syntax CBandUserPeriod period

period - available units: S (seconds), M (minutes), H (hours), D (days), W (weeks)


Example CBandUserPeriod 1W
CBandUserPeriod 14D
CBandUserPeriod 60M

Name CBandUserPeriodSlice
Description Specifies a period slice length
Default slice_len = limit
Context <CBandUser>
Syntax CBandUserPeriodSlice slice_length


Example 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 ...
返回页首
阅览会员资料 发送站内信件
上岸的鱼
半仙


注册时间: 2005-09-15
文章: 2

文章发表于: Mon 2006-11-06 18:58:27    发表主题: 引用并回复

速度是限制住了,但是限制的并不严格,下载速度并不是自己想要的值,不知道是哪儿的问题
CBandLimit 10000000M
CBandSpeed 420 50 100
CBandRemoteSpeed 240 350 300
CBandPeriod 1H

这样设置应该下载速度在多少?
返回页首
阅览会员资料 发送站内信件
从以前的文章开始显示:   
发表新文章   这个论题已经被锁定,您不能发表、回复或者编辑文章。    FreeBSD China -> 安装-配置-优化-安全 论坛时间为 北京时间
前往页面 1, 2  下一页
1页/共2

 
转跳到:  
不能发布新主题
不能在这个论坛回复主题
不能在这个论坛编辑自己的文章
不能在这个论坛删除自己的文章
不能在这个论坛发表投票


Powered by phpBB 2023cc © 2003 Opensource Steps; © 2003-2009 The FreeBSD Simplified Chinese Project
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Project Honey Pot and phpBB.cc
silvery-trainer
The FreeBSD China Project 网站: 中文计划网站 社区网站
The FreeBSD China Project 版权所有 (C) 1999 - 2003 网页设计版权 著作权和商标