From 6bdd5000a8386f5f1d009b7c52a896a869ef23a5 Mon Sep 17 00:00:00 2001 From: Matee Ullah Malik Date: Fri, 19 Sep 2025 18:13:31 +0500 Subject: [PATCH] reduce concurrency --- p2p/kademlia/dht.go | 2 +- p2p/kademlia/network.go | 2 +- supernode/services/cascade/adaptors/p2p.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/p2p/kademlia/dht.go b/p2p/kademlia/dht.go index 60150ceb..493f90f1 100644 --- a/p2p/kademlia/dht.go +++ b/p2p/kademlia/dht.go @@ -1697,7 +1697,7 @@ func (s *DHT) IterateBatchStore(ctx context.Context, values [][]byte, typ int, i func (s *DHT) batchStoreNetwork(ctx context.Context, values [][]byte, nodes map[string]*Node, storageMap map[string][]int, typ int) chan *MessageWithError { responses := make(chan *MessageWithError, len(nodes)) - maxStore := 48 + maxStore := 16 if ln := len(nodes); ln < maxStore { maxStore = ln } diff --git a/p2p/kademlia/network.go b/p2p/kademlia/network.go index 56e7ac55..2c1479cb 100644 --- a/p2p/kademlia/network.go +++ b/p2p/kademlia/network.go @@ -627,7 +627,7 @@ func (s *Network) Call(ctx context.Context, request *Message, isLong bool) (*Mes // ---- retryable RPC helpers ------------------------------------------------- func (s *Network) rpcOnceWrapper(ctx context.Context, cw *connWrapper, remoteAddr string, data []byte, timeout time.Duration, msgType int) (*Message, error) { - writeDL := calcWriteDeadline(timeout, len(data), 2.0) // target ~2 MB/s + writeDL := calcWriteDeadline(timeout, len(data), 1.0) // target ~2 MB/s retried := false for { diff --git a/supernode/services/cascade/adaptors/p2p.go b/supernode/services/cascade/adaptors/p2p.go index be2eb74c..78e9b1bf 100644 --- a/supernode/services/cascade/adaptors/p2p.go +++ b/supernode/services/cascade/adaptors/p2p.go @@ -20,7 +20,7 @@ import ( ) const ( - loadSymbolsBatchSize = 3000 + loadSymbolsBatchSize = 2500 // Minimum first-pass coverage to store before returning from Register (percent) storeSymbolsPercent = 18