Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize RocksDB DB open options (#3316)
## Motivation RocksDB is implemented as an SST. So it has some in memory buffer, that gets flushed to disk when certain criteria is met. What was happening was that we weren't flushing data to disk frequently enough, and the implementation we're using to get an iterator in `find_keys_by_prefix` flushes some tombstones to disk, if necessary. And since we weren't flushing data to disk frequently enough, it often was. This was causing an increase in those reads of a few tens of ms, which when trying to make the client achieve high TPS makes a big difference. ## Proposal Reduce the size of the write buffer in general, so that we flush to disk more often. This overall seems to improve performance. Based on this https://github.com/facebook/rocksdb/wiki/RocksDB-Tuning-Guide#flushing-options We had at most 2 write buffers before of 64 mb each, which is the default settings. Now we have at most 16 write buffers with 8 mb each. Memory usage should stay the same, but disk flushing will be more frequent. I also changed the compression type to `Lz4`, which should be slightly faster than the default, `Snappy`. ## Test Plan Ran benchmark locally, time it takes to reach a certain BPS isn't increasing with time anymore. Ran it for almost 4 hours, it stays within the same range of 400-700ms ## Release Plan - Nothing to do / These changes follow the usual release cycle.
- Loading branch information