mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-10 15:14:09 +00:00
lib/mergeset: use more rawItemsShard shards on multi-CPU systems
This should improve the scalability for registering of new time series on multi-CPU system
This commit is contained in:
parent
ad35068c3a
commit
7bad7133bc
1 changed files with 9 additions and 2 deletions
|
@ -125,9 +125,16 @@ type rawItemsShards struct {
|
|||
// The number of shards for rawItems per table.
|
||||
//
|
||||
// Higher number of shards reduces CPU contention and increases the max bandwidth on multi-core systems.
|
||||
var rawItemsShardsPerTable = cgroup.AvailableCPUs()
|
||||
var rawItemsShardsPerTable = func() int {
|
||||
cpus := cgroup.AvailableCPUs()
|
||||
multiplier := cpus
|
||||
if multiplier > 16 {
|
||||
multiplier = 16
|
||||
}
|
||||
return (cpus * multiplier + 1) / 2
|
||||
}()
|
||||
|
||||
const maxBlocksPerShard = 512
|
||||
const maxBlocksPerShard = 256
|
||||
|
||||
func (riss *rawItemsShards) init() {
|
||||
riss.shards = make([]rawItemsShard, rawItemsShardsPerTable)
|
||||
|
|
Loading…
Reference in a new issue