m3 icon indicating copy to clipboard operation
m3 copied to clipboard

[coordinator] Reduce allocs and CPU load on remote write

Open robskillington opened this issue 6 years ago • 1 comments

What this PR does / why we need it:

Removes most of the per-metric allocations from the remote write endpoint, the only allocations left are the iterators (which are bulk allocated) but not the ID or tags themselves, and the protobuf unmarshal and snappy decode allocations.

TODO:

  • [ ] Use a linked list of fixed size mmap buffers as backing bytes for incoming requests protobuf deserializer, making it very easy to pool the buffers for an arbitrary sized request. (Can either use mmap buffers with runtime.SetFinalizer to munmap when the encompassing buffer is released to ensure no leaks or just pooling raw byte slices)

Special notes for your reviewer:

Does this PR introduce a user-facing and/or backwards incompatible change?:

NONE

Does this PR require updating code package or user-facing documentation?:

NONE

robskillington avatar Jun 20 '19 11:06 robskillington