Skip to content

Commit 7b258f6

Browse files
committed
server: raise DefaultCacheSize to 256MiB
Increase the default size of the storage engine's block cache from 128MiB to 256MiB. The 128MiB default is grossly inadequate, especially in the context of Pebble's 64MiB memtable size which subtracts from the block cache. With the old 128 MiB cache size, the block cache size is effectively zero. We maintain one 64MiB memtable as the mutable memtable and one 64MiB memtable for recycling. Both draw down from the block cache's memory, leaving nothing for caching blocks. We should consider updating the default to be a percentage of available memory (see #128190), but updating to a percentage is a more involved change and runs afoul of expectations of some tests. As a temporary stopgap, we double the fixed default size of the block cache. Informs: #128190 Epic: none Release note (ops change): Raises the cache size for the storage engine's block cache to 256MiB. Note production systems should always configure this setting.
1 parent 3cf81a8 commit 7b258f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/server/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ import (
5656
// Context defaults.
5757
const (
5858
// DefaultCacheSize is the default size of the Pebble cache. We default the
59-
// cache size to 128MiB and SQL memory pool size to 256 MiB. Larger values
60-
// might provide significantly better performance, but we're not sure what
61-
// type of system we're running on (development or production or some shared
59+
// cache size and SQL memory pool size to 256 MiB. Larger values might
60+
// provide significantly better performance, but we're not sure what type of
61+
// system we're running on (development or production or some shared
6262
// environment). Production users should almost certainly override these
6363
// settings and we'll warn in the logs about doing so.
64-
DefaultCacheSize = 128 << 20 // 128 MiB
64+
DefaultCacheSize = 256 << 20 // 256 MiB
6565
defaultSQLMemoryPoolSize = 256 << 20 // 256 MiB
6666
defaultScanInterval = 10 * time.Minute
6767
defaultScanMinIdleTime = 10 * time.Millisecond

0 commit comments

Comments
 (0)