cockroachdb / cockroachdb/cockroach

net: record TCP congestion window `cwnd` metric

Open
#151,212 0 comments 0 reactions 0 assignees View on GitHub
A-cluster-observability A-kv-observability A-server-networking A-sql-observability C-enhancement T-db-server
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Once #149959 is addressed, we should be able to easily access the congestion window (`cwnd`) of each TCP connection. Like `RTT` and `RTTvar`, the `cwnd` is available in the `tcpInfo` struct as `Snd_cwnd`.

https://github.com/mikioh/tcpinfo/blob/30a79bb1804bc47fa7fe29928c9109f368792a9e/zsys_linux.go#L58

We should use a guage for this metric, as it can increase and decrease. The `cwnd` can increase and decrease mutiple times per-second, so collecting it at the default hearbeat frequency of 1 second won't provide a perfect picture. It should still be helpful in helping us better understand TCP congestion control behavior.

Jira issue: CRDB-53119

Contributor guide

Open the contributing guide

Research direction

First check whether #149959 has been addressed, then inspect the existing RTT and RTTvar metric paths and the tcpInfo integration. The referenced tcpinfo zsys_linux.go entry shows Snd_cwnd as the source; done means exposing it as a gauge and covering its collection behavior, including the default one-second heartbeat limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking, observability-sre
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.