mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
ethdb/pebble: adjust the number of memory tables
This commit is contained in:
parent
23f07d8c93
commit
3c41c1829c
1 changed files with 6 additions and 3 deletions
|
|
@ -199,9 +199,12 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (
|
||||||
// Taken from https://github.com/cockroachdb/pebble/blob/master/internal/constants/constants.go
|
// Taken from https://github.com/cockroachdb/pebble/blob/master/internal/constants/constants.go
|
||||||
maxMemTableSize := (1<<31)<<(^uint(0)>>63) - 1
|
maxMemTableSize := (1<<31)<<(^uint(0)>>63) - 1
|
||||||
|
|
||||||
// Two memory tables is configured which is identical to leveldb,
|
// Four memory tables are configured, each with a default size of 256 MB.
|
||||||
// including a frozen memory table and another live one.
|
// Having multiple smaller memory tables while keeping the total memory
|
||||||
memTableLimit := 2
|
// limit unchanged allows writes to be flushed more smoothly. This helps
|
||||||
|
// avoid compaction spikes and mitigates write stalls caused by heavy
|
||||||
|
// compaction workloads.
|
||||||
|
memTableLimit := 4
|
||||||
memTableSize := cache * 1024 * 1024 / 2 / memTableLimit
|
memTableSize := cache * 1024 * 1024 / 2 / memTableLimit
|
||||||
|
|
||||||
// The memory table size is currently capped at maxMemTableSize-1 due to a
|
// The memory table size is currently capped at maxMemTableSize-1 due to a
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue