discovery: introduce rate limiter to GossipSyncer
This commit is contained in:
2 files changed
+29
-2
No files matched your search
@@ -40,6 +40,11 @@ const (
|
||||
// they'll be refilled at this rate.
|
||||
DefaultMsgBytesPerSecond = 1000 * 1_024
|
||||
|
||||
// DefaultPeerMsgBytesPerSecond is the max bytes/s we'll permit for
|
||||
// outgoing messages for a single peer. Once tokens (bytes) have been
|
||||
// taken from the bucket, they'll be refilled at this rate.
|
||||
DefaultPeerMsgBytesPerSecond = 50 * 1_024
|
||||
|
||||
// assumedMsgSize is the assumed size of a message if we can't compute
|
||||
// its serialized size. This comes out to 1 KB.
|
||||
assumedMsgSize = 1_024
|
||||
|
||||
Reference in new issue
Block a user