Skip to content

Commit

Permalink
Fix memory alloc config (filodb#1638)
Browse files Browse the repository at this point in the history
Default alloc configs should sum to 100.
  • Loading branch information
vishramachandran authored Jul 24, 2023
1 parent 59cae2a commit ea1644b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/main/resources/filodb-defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ filodb {
# (used for storing chunks)
# This is divvied amongst datasets on the node per configuration for dataset
# The shards of the dataset on the node get even amount of memory from this fraction
block-memory-manager-percent = 73
block-memory-manager-percent = 71
}

# At the cost of some extra heap memory, we can track queries holding shared lock for a long time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ extends TimeSeriesStore with StrictLogging {
val nativeMemoryManagerPercent = filodbConfig.getDouble("memstore.memory-alloc.native-memory-manager-percent")
val blockMemoryManagerPercent = filodbConfig.getDouble("memstore.memory-alloc.block-memory-manager-percent")
val lucenePercent = filodbConfig.getDouble("memstore.memory-alloc.lucene-memory-percent")
require(nativeMemoryManagerPercent + blockMemoryManagerPercent + lucenePercent == 100.0,
s"Configured Block($nativeMemoryManagerPercent), Native($nativeMemoryManagerPercent) " +
require(Math.abs(nativeMemoryManagerPercent + blockMemoryManagerPercent + lucenePercent - 100) < 0.001,
s"Configured Block($nativeMemoryManagerPercent), Native($blockMemoryManagerPercent) " +
s"and Lucene($lucenePercent) memory percents don't sum to 100.0")
(availableMemoryBytes * nativeMemoryManagerPercent / 100).toLong
} else filodbConfig.getMemorySize("memstore.ingestion-buffer-mem-size").toBytes
Expand Down

0 comments on commit ea1644b

Please sign in to comment.