speedb-io / speedb

A RocksDB compliant high performance scalable embedded key-value store
https://www.speedb.io/
Apache License 2.0
882 stars 65 forks source link

Options: level_compaction_dynamic_level_bytes not working properly #786

Open Yuval-Ariel opened 8 months ago

Yuval-Ariel commented 8 months ago

In a write heavy workload, where L0-L1 compaction is the bottleneck, the level_compaction_dynamic_level_bytes flag can cause serious stalls caused by huge (40 Gb) L0-L1 compactions. Can be seen in the pic below: image

This problem exists mainly with the speedb delay mechanism (controlled by the flag use_dynamic_delay). Further research needs to be done in order to understand and fix this behaviour.

Until then, Turn off the level_compaction_dynamic_level_bytes flag by default.

The cmd to reproduce the above Fig. is: db_bench --compression_type=None -db=/data/ -num=40000000 -value_size=1000 -key_size=16 -report_interval_seconds=1 -stats_dump_period_sec=120 -num_column_families=1 -write_buffer_size=67108864 -histogram --delayed_write_rate=536870912 -max_write_buffer_number=4 -db_write_buffer_size=0 -max_background_compactions=8 -cache_size=8388608 -max_background_flushes=4 -bloom_bits=10 -benchmark_read_rate_limit=0 -benchmark_write_rate_limit=0 -report_file=fillrandom.csv --disable_wal=true --benchmarks=fillrandom,levelstats,memstats --memtablerep=skip_list -compaction_readahead_size=0 ' and then overwrite: db_bench --compression_type=None -db=/data/ -num=40000000 -value_size=1000 -key_size=16 -report_interval_seconds=1 -stats_dump_period_sec=120 -num_column_families=1 -write_buffer_size=67108864 -histogram --delayed_write_rate=536870912 -max_write_buffer_number=4 -db_write_buffer_size=0 -max_background_compactions=8 -cache_size=8388608 -max_background_flushes=4 -bloom_bits=10 -duration=900 --use_existing_db -threads=50 -duration=900 -benchmark_read_rate_limit=0 -benchmark_write_rate_limit=0 -report_file=overwrite.csv --benchmarks=overwrite,levelstats,memstats --memtablerep=skip_list -compaction_readahead_size=0 and compare tolevel_compaction_dynamic_level_bytes = 0`

Yuval-Ariel commented 8 months ago

this problem is already in release 2.7: image