1. 2006-04-20.理解SurgeProtection

Surge Protection防汹 -- 哈哈哈!MoinMoin1.5.3 最新特性!

1.1. 遭遇

兴冲冲升级好MoinMoin 后,象以往那样快速浏览页面时,突然!

Warning: 
You triggered the wiki's surge protection by doing too many requests
in a short time.
Please make a short break reading the stuff you already got.
When you restart doing requests AFTER that, slow down or you might get
locked out for a longer time!
  • 接着就很长时间不能访问…………

呜乎哀哉!气愤之余以为是速度问题,调整为 mod_python 模式依然,询问了moin-user 列表才知道是新特性!

1.2. 学习

原来 1.3.X 和 1.5.X 相差悬殊,升级了一批系统页面后看到了 SurgeProtection 的说明, 但是不甚了了,这个设置是什么意思?

   1 surge_action_limits = { # allow max. <count> <action> requests per <dt> secs
   2         # action: (count, dt)
   3         'show': (20, 60),
   4         'raw': (20, 40),  # some people use this for css
   5         'AttachFile': (60, 60),
   6         'diff': (30, 60),
   7         'fullsearch': (5, 60),
   8         'edit': (10, 120),
   9         'rss_rc': (1, 60),
  10         'default': (30, 60),
  11     }
  12 surge_lockout_time = 3600 # secs you get locked out when you ignore warnings

what means <count> <action> requests per <dt> secs ???!

1.3. 明了

快速在 wikiconfig.py 中设置后,依然会不时有报怨……

From: Thomas Waldmann <[email protected]>     Mailed-By: lists.sourceforge.net 
To: [email protected]
Date: Apr 19, 2006 7:56 AM
Subject: Re: [Moin-user] HOWTO setup Surge Protection?

终于问到了点子上,MoinMoin 的开发核心人士权威回答:

>> it means that for some "action" you can do max "count" requests in "dt"
>> seconds.
> the key is what means "dt" sec. ?

delta t (or short dt) is the usual abbreviaton for a time intervall.

> 'edit': (10, 120),
> is equal to 'edit': (1, 12),  ??

If you assume equal request distribution over time, it is the same.

If you don't assume that (and on the internet you can't assume that), it
is not the same as in the first case you can have a burst of 9 requests
in 1 second and 1 request in the next 119 seconds  and it still is ok
because it is 10r in 120s total. In the second case 9 request in 1
second will trigger surge protection as you only allow 1 request in 12
seconds (bad idea for most actions except rss_rc maybe).

嗬嗬,原来如比! dt==Δtime==时间间隔

action: (count, dt) 约定了在一定时间区间内,被允许发生的 动作的最高次数!

高!实在是高!!

MoinMoin 越发的象一个应用平台,而非简单的维基 系统了………………