An LSM store has fine average write latency but sometimes stalls writes for seconds. What is happening, and what do you do?
Sketch your own answer first, then compare it with the one below.
A strong answer
Compaction has fallen behind ingest. Files are piling up faster than they merge, so the store slows or stops writes to let compaction catch up, rather than let read cost and disk use grow without bound. The memtable may also be full while the previous one is still flushing.
Possible fixes are to give compaction more I/O bandwidth, to add parallel compaction threads, to switch to a policy that rewrites less, to smooth ingest with a queue upstream, or to leave headroom so a burst does not outrun the merge. Limiting the rate of compaction I/O so it does not starve reads is the other side of the same trade.
A good answer treats the stall as a signal that sustained write rate is above what the compaction policy can merge, not as a random glitch.
Sources
- Chen Luo, Michael J. Carey (2020). LSM-based storage techniques: a survey.