lib/mergeset: increase pool capacity for inmemoryBlock according to collected profiles from production workload

CPU and memory profiles show that the pool capacity for inmemoryBlock objects is too small.
This results in the increased load on memory allocation code in Go runtime.
Increase the pool capacity in order to reduce the load on Go runtime.
This commit is contained in:
Aliaksandr Valialkin 2021-07-06 13:41:32 +03:00
parent f71e4d1853
commit 78c9174682

View file

@ -562,4 +562,4 @@ func putInmemoryBlock(ib *inmemoryBlock) {
// Every inmemoryBlock struct occupies at least 64KB of memory, e.g. quite big amounts of memory.
// Use a chan instead of sync.Pool in order to reduce memory usage on systems
// with big number of CPU cores.
var ibPoolCh = make(chan *inmemoryBlock, cgroup.AvailableCPUs())
var ibPoolCh = make(chan *inmemoryBlock, 100*cgroup.AvailableCPUs())