mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-04-24 22:32:13 +00:00
feat: reduce stream idle timeout to 1m
It's currently 10 minutes. This change will kill all inbound DHT streams that haven't been used in 1 minute. We keep streams around to avoid the cost of setting up new streams (the multistream overhead, mostly). However, each one of these takes at least one goroutine and some other state. Ideally, this will let us run multiple DHTs side-by-side without keeping one stream per peer per DHT open.
This commit is contained in:
parent
995fee9e53
commit
3f8b219554
@ -23,7 +23,7 @@ import (
|
||||
)
|
||||
|
||||
var dhtReadMessageTimeout = time.Minute
|
||||
var dhtStreamIdleTimeout = 10 * time.Minute
|
||||
var dhtStreamIdleTimeout = 1 * time.Minute
|
||||
var ErrReadTimeout = fmt.Errorf("timed out reading response")
|
||||
|
||||
// The Protobuf writer performs multiple small writes when writing a message.
|
||||
|
Loading…
x
Reference in New Issue
Block a user