cockroachdb / cockroachdb/cockroach

kvserver: account for cpu time spent processing raft transport stream per replica

Open
#107,800 0 comments 0 reactions 0 assignees View on GitHub
A-kv C-enhancement T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Is your feature request related to a problem? Please describe.**
Decompressing byte data and unmarshalling protos uses a noticeable amount of CPU. We record CPU usage used in replication per replica already [^1][^2][^3]. However, we don't attribute the raft transport CPU usage.

This issue is to attribute raft transport CPU use to a replica.

**Describe the solution you'd like**

Attribute the CPU usage of this function call, to the replicas the batch concerns:

https://github.com/cockroachdb/cockroach/blob/1d3c11efe8a5368cff3a3eec4668bf866c10952d/pkg/kv/kvserver/raft_transport.go#L504-L504

**Additional context**

Red outlined area shows the CPU to be attributed

![image](https://github.com/cockroachdb/cockroach/assets/39606633/c4ddf8c1-9753-4f35-a9ce-a1912c12c7de)

[^1]: https://github.com/cockroachdb/cockroach/blob/1d3c11efe8a5368cff3a3eec4668bf866c10952d/pkg/kv/kvserver/store_raft.go#L380-L380
[^2]: https://github.com/cockroachdb/cockroach/blob/1d3c11efe8a5368cff3a3eec4668bf866c10952d/pkg/kv/kvserver/store_raft.go#L686-L686
[^3]: https://github.com/cockroachdb/cockroach/blob/1d3c11efe8a5368cff3a3eec4668bf866c10952d/pkg/kv/kvserver/store_raft.go#L714-L714

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.