Surge Protection

How it works

After experiencing high server load caused by bots and leechers often, I added some code to MoinMoin.request: surge protection.

It works like this:

So if you stay below count in any time interval dt (see below), you never will have problems.

If you are fast and go beyond that count in some interval, you will receive warning messages to slow down.

For any warning msg you get, it will add some rather sticky history entry (because it has a future timestamp, it will stay there for about lockout_time length).

If you react to the warning msg and slow down, this won't make you real trouble (it will just reduce the maximum for you a bit) and most of your access should leave history about a minute later.

If you don't react and continue at high rate (maybe you are a bot, not reading warnings?), those sticky entries will make the history longer than allowed and thus, you won't be able to recover until lockout_time later.

Watching it

cd data/cache/surgeprotect
watch cat surge-log

See also HelpOnConfiguration/SurgeProtection.

MoinMoin: SurgeProtection (last edited 2008-04-02 07:12:47 by ThomasWaldmann)