Closed niksajakovljevic closed 1 year ago
This is potentially blocked on https://github.com/timescale/promscale/pull/1753 . Since now we keep array pool the trick that we were doing at https://github.com/timescale/promscale/blob/master/pkg/pgmodel/ingestor/ingestor.go#L236 will not play nicely any more. So either we clear the protobufs after the ingest (like proposed in #1753) or refactor to copy samples.
I am also a bit concerned about higher memory usage.
Sharing memory profile of given optimization (left) and existing master (right).
Memory in use:
Objects in use:
It does seem that array pools don't have huge initial spike in memory. Also number of allocated objects is noticeably smaller.
Surprisingly cluster benchmark is showing that this implementation uses more memory.
I'll investigate further.
Project got deprecated
We reuse one bigger array and avoid allocating smaller arrays for each Timeseries. This results in less memory allocations.
Before:
BenchmarkProtoUnmarshall-10 144 8194256 ns/op 22833242 B/op 150342 allocs/op
After:
BenchmarkProtoUnmarshall-10 145 8174649 ns/op 32628033 B/op 100650 allocs/op
So the allocations are down by around 1/3, however memory usage is up for 1/3 due to larger arrays being allocated.