Reduce WAL checkpoint interval from 30s to 5s
Under heavy write load, 30 seconds is too long between checkpoints, causing the WAL to grow and slow down read queries. More aggressive checkpointing keeps the WAL small and maintains read performance.
This commit is contained in:
parent
f1d7c21478
commit
4f62b280c5
@ -14,7 +14,8 @@ import (
|
||||
const (
|
||||
// checkpointInterval is how often to run WAL checkpoint.
|
||||
// Frequent checkpoints keep the WAL small, improving read performance.
|
||||
checkpointInterval = 30 * time.Second
|
||||
// Under heavy write load, we need aggressive checkpointing.
|
||||
checkpointInterval = 5 * time.Second
|
||||
|
||||
// vacuumInterval is how often to run incremental vacuum.
|
||||
// Since incremental vacuum only frees ~1000 pages (~4MB) per run,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user