diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-09-14 20:22:44 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-09-14 20:22:44 -0400 |
commit | 42585681acaed341f32a104a3873ad0566f9ca51 (patch) | |
tree | 60d96f0642cc6f67bdc263b3018a5c097d7c5304 | |
parent | 1652956786d73f020de534e935126c64c04eebd9 (diff) | |
download | keysafe-42585681acaed341f32a104a3873ad0566f9ca51.tar.gz |
Make rate limiter adapt to ongoing load more quickly -- every 15 minutes instead of every 60.
-rw-r--r-- | CHANGELOG | 2 | ||||
-rw-r--r-- | HTTP/RateLimit.hs | 2 |
2 files changed, 3 insertions, 1 deletions
@@ -2,6 +2,8 @@ keysafe (0.20160915) UNRELEASED; urgency=medium * Reduce number of buckets in rate limiter, avoiding ones with very low proof of work. + * Make rate limiter adapt to ongoing load more quickly -- every 15 + minutes instead of every 60. -- Joey Hess <id@joeyh.name> Wed, 14 Sep 2016 20:19:43 -0400 diff --git a/HTTP/RateLimit.hs b/HTTP/RateLimit.hs index e58b543..3a17a5a 100644 --- a/HTTP/RateLimit.hs +++ b/HTTP/RateLimit.hs @@ -392,7 +392,7 @@ adjusterThread cfg storedir ratelimiter logger = forever $ do delay (1000000 * intervalsecs) checkRequestRate cfg storedir ratelimiter logger intervalsecs where - intervalsecs = 60*60 + intervalsecs = 60*15 checkRequestRate :: ServerConfig -> Maybe LocalStorageDirectory -> RateLimiter -> Logger -> Integer -> IO () checkRequestRate cfg storedir ratelimiter logger intervalsecs = do |