cockroachdb / cockroachdb/cockroach
kvserver: account for cpu time spent processing raft transport stream per replica
- 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

[^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
Assessment
This issue has not been assessed yet.