From 25bb556feed6e9bfdf746242e8f335dfebc6b507 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Wed, 16 Jun 2021 17:27:41 +0200 Subject: [PATCH] p2p: increase queue size to 16MB (#6588) --- internal/p2p/queue.go | 3 +++ internal/p2p/wdrr_queue.go | 2 -- internal/statesync/reactor.go | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/p2p/queue.go b/internal/p2p/queue.go index 57c2722da..cf36d3ca6 100644 --- a/internal/p2p/queue.go +++ b/internal/p2p/queue.go @@ -4,6 +4,9 @@ import ( tmsync "github.com/tendermint/tendermint/internal/libs/sync" ) +// default capacity for the size of a queue +const defaultCapacity uint = 16e6 // ~16MB + // queue does QoS scheduling for Envelopes, enqueueing and dequeueing according // to some policy. Queues are used at contention points, i.e.: // diff --git a/internal/p2p/wdrr_queue.go b/internal/p2p/wdrr_queue.go index 6c8654044..b99403be2 100644 --- a/internal/p2p/wdrr_queue.go +++ b/internal/p2p/wdrr_queue.go @@ -10,8 +10,6 @@ import ( "github.com/tendermint/tendermint/libs/log" ) -const defaultCapacity uint = 1048576 // 1MB - // wrappedEnvelope wraps a p2p Envelope with its precomputed size. type wrappedEnvelope struct { envelope Envelope diff --git a/internal/statesync/reactor.go b/internal/statesync/reactor.go index 8ce906eef..be88bc545 100644 --- a/internal/statesync/reactor.go +++ b/internal/statesync/reactor.go @@ -84,13 +84,13 @@ const ( recentSnapshots = 10 // snapshotMsgSize is the maximum size of a snapshotResponseMessage - snapshotMsgSize = int(4e6) + snapshotMsgSize = int(4e6) // ~4MB // chunkMsgSize is the maximum size of a chunkResponseMessage - chunkMsgSize = int(16e6) + chunkMsgSize = int(16e6) // ~16MB // lightBlockMsgSize is the maximum size of a lightBlockResponseMessage - lightBlockMsgSize = int(1e7) + lightBlockMsgSize = int(1e7) // ~10MB // lightBlockResponseTimeout is how long the dispatcher waits for a peer to // return a light block