ratelimiter: Bump up to 16kb/min from 4kb/min
authorAndrey Petrov <andrey.petrov@shazow.net>
Sat, 6 Aug 2016 20:40:27 +0000 (16:40 -0400)
committerAndrey Petrov <andrey.petrov@shazow.net>
Sat, 6 Aug 2016 20:41:19 +0000 (16:41 -0400)
sshd/ratelimit.go

index 16eef95337f6bba35870860fa756336845f0628e..b2607e6dca159ceb4973c6d65c9b24cf0b459e3c 100644 (file)
@@ -44,7 +44,7 @@ type inputLimiter struct {
 func NewInputLimiter() rateio.Limiter {
        grace := time.Second * 3
        return &inputLimiter{
-               Amount:    200 * 4 * 5, // Assume fairly high typing rate + margin for copypasta of links + large key handshakes
+               Amount:    2 << 14, // ~16kb, should be plenty for a high typing rate/copypasta/large key handshakes.
                Frequency: time.Minute * 1,
                readCap:   128,          // Allow up to 128 bytes per read (anecdotally, 1 character = 52 bytes over ssh)
                numRead:   -1024 * 1024, // Start with a 1mb grace