Commit 3f8b2195 authored by Steven Allen's avatar Steven Allen

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.
parent 995fee9e
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment