778e179046
Summary: During compaction, we sync the output files after they are fully written out. This causes unnecessary blocking of the compaction thread and burstiness of the write traffic. This diff simply asks the OS to sync data incrementally as they are written, on the background. The hope is that, at the final sync, most of the data are already on disk and we would block less on the sync call. Thus, each compaction runs faster and we could use fewer number of compaction threads to saturate IO. In addition, the write traffic will be smoothed out, hopefully reducing the IO P99 latency too. Some quick tests show 10~20% improvement in per thread compaction throughput. Combined with posix advice on compaction read, just 5 threads are enough to almost saturate the udb flash bandwidth for 800 bytes write only benchmark. What's more promising is that, with saturated IO, iostat shows average wait time is actually smoother and much smaller. For the write only test 800bytes test: Before the change: await occillate between 10ms and 3ms After the change: await ranges 1-3ms Will test against read-modify-write workload too, see if high read latency P99 could be resolved. Will introduce a parameter to control the sync interval in a follow up diff after cleaning up EnvOptions. Test Plan: make check; db_bench; db_stress Reviewers: dhruba CC: leveldb Differential Revision: https://reviews.facebook.net/D11115 |
||
---|---|---|
.. | ||
arena_test.cc | ||
arena.cc | ||
arena.h | ||
auto_roll_logger_test.cc | ||
auto_roll_logger.cc | ||
auto_roll_logger.h | ||
bloom_test.cc | ||
bloom.cc | ||
build_version.h | ||
cache_test.cc | ||
cache.cc | ||
coding_test.cc | ||
coding.cc | ||
coding.h | ||
comparator.cc | ||
crc32c_test.cc | ||
crc32c.cc | ||
crc32c.h | ||
env_hdfs.cc | ||
env_posix.cc | ||
env_test.cc | ||
env.cc | ||
filelock_test.cc | ||
filter_policy.cc | ||
hash.cc | ||
hash.h | ||
histogram_test.cc | ||
histogram.cc | ||
histogram.h | ||
ldb_cmd_execute_result.h | ||
ldb_cmd.cc | ||
ldb_cmd.h | ||
ldb_tool.cc | ||
logging.cc | ||
logging.h | ||
murmurhash.cc | ||
murmurhash.h | ||
mutexlock.h | ||
options.cc | ||
posix_logger.h | ||
random.h | ||
signal_test.cc | ||
stack_trace.h | ||
stats_logger.h | ||
status.cc | ||
stop_watch.h | ||
string_util.cc | ||
string_util.h | ||
testharness.cc | ||
testharness.h | ||
testutil.cc | ||
testutil.h |