- 论坛徽章:
- 1
|
原帖由 hydcn 于 2005-12-2 08:54 发表
请问你上述的功能是怎么实现的,能否指点一二?谢谢!
Load Average control ,sendmail.cf 中找下列資料,
- # load average at which we just queue messages
- #O QueueLA=12
- # load average at which we refuse connections
- #O RefuseLA=15
- # load average at which we delay connections; 0 means no limit
- O DelayLA=10
复制代码
或是看 cf/README
- confQUEUE_LA QueueLA [varies] Load average at which
- queue-only function kicks in.
- Default values is (8 * numproc)
- where numproc is the number of
- processors online (if that can be
- determined).
- confREFUSE_LA RefuseLA [varies] Load average at which
- incoming SMTP connections are
- refused. Default values is (12 *
- numproc) where numproc is the
- number of processors online (if
- that can be determined).
- confREJECT_LOG_INTERVAL RejectLogInterval [3h] Log interval when
- refusing connections for this long.
- confDELAY_LA DelayLA [0] Load average at which sendmail
- will sleep for one second on most
- SMTP commands and before accepting
- connections. 0 means no limit.
复制代码
rate control 要 sendmail 8.13.X 以上的版本才有,
sendmail.mc 中 至少要有如下內容:
- ...前略
- # 代表要做
- FEATURE(`delay_checks')dnl 做延緩檢查,也就是先不做如 SMTP AUTH check, rbl check 等,先檢查其他條件
- FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access') dnl 這個你應該本來就要知道
- FEATURE(`ratecontrol', `nodelay', `terminate') dnl 連接頻率設定功能開啟
- ....後略
复制代码
設定的內容是寫在 access 中,請自參考 sendmail 的 cf/README
- ratecontrol Enable simple ruleset to do connection rate control
- checking. This requires entries in access_db of the form
- ClientRate:IP.ADD.RE.SS LIMIT
- The RHS specifies the maximum number of connections
- (an integer number) over the time interval defined
- by ConnectionRateWindowSize, where 0 means unlimited.
- Take the following example:
- ClientRate:10.1.2.3 4
- ClientRate:127.0.0.1 0
- ClientRate: 10
- 10.1.2.3 can only make up to 4 connections, the
- general limit it 10, and 127.0.0.1 can make an unlimited
- 0;17H
- number of connections per ConnectionRateWindowSize.
- See also CONNECTION CONTROL.
- conncontrol Enable a simple check of the number of incoming SMTP
- connections. This requires entries in access_db of the
- form
- ClientConn:IP.ADD.RE.SS LIMIT
- The RHS specifies the maximum number of open connections
- (an integer number).
- Take the following example:
- ClientConn:10.1.2.3 4
- ClientConn:127.0.0.1 0
- ClientConn: 10
- 10.1.2.3 can only have up to 4 open connections, the
- general limit it 10, and 127.0.0.1 does not have any
- explicit limit.
- See also CONNECTION CONTROL.
复制代码 |
|