diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-09-13 11:47:11 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-09-13 11:47:11 -0400 |
commit | 01c6543c27900764de2d68e65aebd51ea546bc88 (patch) | |
tree | 04289423861604bbf71c3e9561d6f8926861e5ea /HTTP | |
parent | 757daaf669c3b45fe952f922af502ee7197e3d30 (diff) | |
download | keysafe-01c6543c27900764de2d68e65aebd51ea546bc88.tar.gz |
half the fill rate
This decreases the possible maximumStorageRate by half, down from
10 gb/month to 5 gb/month. Which is probably a tolerable amount for
many servers; that's 16 months to fill up a terabyte disk.
Diffstat (limited to 'HTTP')
-rw-r--r-- | HTTP/RateLimit.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/HTTP/RateLimit.hs b/HTTP/RateLimit.hs index e88d617..d8b3dc1 100644 --- a/HTTP/RateLimit.hs +++ b/HTTP/RateLimit.hs @@ -91,13 +91,14 @@ bloomMaxSize = 1000000 -- | Size of the bucket. This allows a burst of accesses after an idle -- period, which is especially useful when retrieving keys that were -- split into multiple chunks. However, setting this too high lets clients --- cheaply store lots of data, so keep the objectSize in mind. +-- cheaply store lots of data on a server that has been idle for a while, +-- which could be an attractive way to abuse keysafe servers. burstSize :: Word64 -burstSize = 4 -- allow 4 objects to be stored/retrieved w/o proof of work +burstSize = 4 -- 256 kb immediate storage -- | Rate that the bucket is filled. fillRate :: Word64 -fillRate = 60000000 -- 1 token per minute +fillRate = 2 * 60 * 1000000 -- 1 token ever other minute -- | How much data could be stored, in bytes per second, assuming all -- buckets in the rate limiter are kept drained, and all requests are |