Skip to content

Conversation

rjl493456442
Copy link
Member

This pull request adjusts the number of allowed memory tables in Pebble.

Pebble allows configuring an arbitrary number of memory tables to hold
unflushed data. When the current memtable becomes full, it is scheduled
for flushing, and a new memtable is allocated to accept subsequent writes.
However, if too many memtables accumulate and are waiting to be flushed,
subsequent writes will stall.

Originally, only two memtables were configured, each with a size of 512 MB
for Ethereum mainnet. While this setup works well under normal conditions,
it becomes problematic under heavy write loads. In such scenarios, flushing
is only triggered when more than 512 MB of data is pending, which may not
be responsive enough. Even worse, if compactions are running concurrently,
flushing memtables can become slow due to the heavy IO overhead, leading
to write stalls across the system.

This pull request tries to mitigate the performance degradation by having
more memory tables but with a smaller size. In this case, the pending writes
can be flushed more smoothly and responsively.

Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM, I think smaller memtables are preferable, given that pebble has a default MemTableSize of 4MB

@rjl493456442 rjl493456442 added this to the 1.15.12 milestone Jun 9, 2025
@rjl493456442 rjl493456442 merged commit 08a03c7 into ethereum:master Jun 9, 2025
3 of 4 checks passed
rjl493456442 added a commit to rjl493456442/go-ethereum that referenced this pull request Jul 19, 2025
This pull request adjusts the number of allowed memory tables in Pebble.

Pebble allows configuring an arbitrary number of memory tables to hold 
unflushed data. When the current memtable becomes full, it is scheduled 
for flushing, and a new memtable is allocated to accept subsequent
writes. However, if too many memtables accumulate and are waiting to be 
flushed, subsequent writes will stall.

Originally, only two memtables were configured, each with a size of 512
MB for Ethereum mainnet. While this setup works well under normal
conditions, it becomes problematic under heavy write loads. In such scenarios,
flushing is only triggered when more than 512 MB of data is pending, which may
not be responsive enough. Even worse, if compactions are running
concurrently, flushing memtables can become slow due to the heavy IO 
overhead, leading to write stalls across the system.

This pull request tries to mitigate the performance degradation by having 
more memory tables but with a smaller size. In this case, the pending
writes can be flushed more smoothly and responsively.
howjmay pushed a commit to iotaledger/go-ethereum that referenced this pull request Aug 27, 2025
This pull request adjusts the number of allowed memory tables in Pebble.

Pebble allows configuring an arbitrary number of memory tables to hold 
unflushed data. When the current memtable becomes full, it is scheduled 
for flushing, and a new memtable is allocated to accept subsequent
writes. However, if too many memtables accumulate and are waiting to be 
flushed, subsequent writes will stall.

Originally, only two memtables were configured, each with a size of 512
MB for Ethereum mainnet. While this setup works well under normal
conditions, it becomes problematic under heavy write loads. In such scenarios,
flushing is only triggered when more than 512 MB of data is pending, which may
not be responsive enough. Even worse, if compactions are running
concurrently, flushing memtables can become slow due to the heavy IO 
overhead, leading to write stalls across the system.

This pull request tries to mitigate the performance degradation by having 
more memory tables but with a smaller size. In this case, the pending
writes can be flushed more smoothly and responsively.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants