From c5e37b289baa0c20a2359247ad0971d228f675d2 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 28 Feb 2014 22:32:59 +0100 Subject: [PATCH] don't overreact when bulk pool is still empty --- utils/cron_banip.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/cron_banip.py b/utils/cron_banip.py index c8fdd78c..53f5e5f1 100755 --- a/utils/cron_banip.py +++ b/utils/cron_banip.py @@ -114,6 +114,11 @@ BLOCK_LIMIT = max(BLOCK_LOWER, BLOCK_UPPER - BLOCK_LOADFAC * (dbload - 75)) BULKLONG_LIMIT = max(BULK_LOWER, BULKLONG_LIMIT - BULK_LOADFAC * (avgload - 14)) if len(prevbulks) > MAX_BULK_IPS: BLOCK_LIMIT = max(3600, BLOCK_LOWER - (len(prevbulks) - MAX_BULK_IPS)*10) +# if the bulk pool is still empty, clients will be faster, avoid having +# them blocked in this case +if len(prevbulks) < 10: + BLOCK_LIMIT = 2*BLOCK_UPPER + # get the new block candidates cur.execute(""" -- 2.39.5