cockroachdb / cockroachdb/cockroach

adaptive idle timeout to better use pooled streams

Open
#146,519 2 comments 0 reactions 0 assignees View on GitHub
A-server-networking C-enhancement T-db-server
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

During DRPC benchmark runs with stream pools enabled, we observed that stream and DRPC connection opened and closed continuously during the run. Streams are closed due to idle timeout (10s) causing the underlying DRPC connection to be closed.

![Image](https://github.com/user-attachments/assets/219e81d1-b682-4dfc-b0f4-f4fc152639b5)

[PR #145907](https://github.com/cockroachdb/cockroach/pull/145907) implemented two changes:
1. Separate stream idle timeout from DRPC connection timeout since connections are more expensive to create.
2. Don't close DRPC connection when a stream is closed. This allows reusing the connections for the new streams.

Since we use an idle timeout of 10s, we can try to tune it to avoid frequently opening and closing the streams but this timeout greatly depends on the workload. An alternative approach is to make the idle timeout adaptable (by estimating an optimal number of stream required).

Jira issue: CRDB-50569

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.