Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: explore use of direct IO for the RocksDB WAL #13620

Closed
petermattis opened this issue Feb 16, 2017 · 4 comments
Closed

perf: explore use of direct IO for the RocksDB WAL #13620

petermattis opened this issue Feb 16, 2017 · 4 comments
Assignees
Labels
C-performance Perf of queries or internals. Solution not expected to change functional behavior.
Milestone

Comments

@petermattis
Copy link
Collaborator

RocksDB 5.1.2 added support for using direct IO (O_DIRECT) for writes. This might be a faster option than using fsync/fdatasync after writing the WAL.

@petermattis petermattis self-assigned this Feb 16, 2017
@petermattis petermattis added the C-performance Perf of queries or internals. Solution not expected to change functional behavior. label Feb 16, 2017
@petermattis petermattis added this to the Q1 2017 milestone Feb 23, 2017
@dianasaur323 dianasaur323 modified the milestones: Q2 2017, Q1 2017, 1.1 Apr 18, 2017
@tbg
Copy link
Member

tbg commented Jun 25, 2017

cc @irfansharif - not sure, but maybe this option is something that would apply to the Raft log RocksDB instance?

@irfansharif
Copy link
Contributor

it does, have this in my notes somewhere. on my radar for when tuning RocksDB for raft log workload.

@irfansharif irfansharif self-assigned this Jun 25, 2017
@petermattis
Copy link
Collaborator Author

In more recent RocksDB releases, the option became use_direct_io_for_flush_and_compaction and only applies to reads and writes performed by background flushes and compactions. So direct IO could not be used as a replacement for syncing the WAL.

Enabling use_direct_io_for_flush_and_compaction on a write-only workload showed a 5-10% performance decrease. Disk utilization jump from ~50% to ~75% and disk read bandwidth jumped from 0 to 60-80 MB/sec. Avoiding the OS buffer cache doesn't seem to be a good idea at this time.

@petermattis petermattis modified the milestones: Later, 1.1 Jul 7, 2017
petermattis added a commit to petermattis/cockroach that referenced this issue Jul 8, 2017
COCKROACH_USE_DIRECT_WRITES is not a knob that should be exposed at this
time.

See cockroachdb#13620
@leventov
Copy link

leventov commented Jun 13, 2018

https://github.com/facebook/rocksdb/wiki/Direct-IO says:

use_direct_io_for_flush_and_compaction and use_direct_reads will only be applied to SST file I/O but not WAL I/O or MANIFEST I/O because the I/O pattern of these files are not suitable for direct I/O

I wonder why WAL I/O pattern is considered not suitable for direct I/O?


Update: Sorry, didn't realise this issue is not in the facebook/rocksdb repo. Asked the same question here: https://groups.google.com/d/msg/rocksdb/hYT9_xSZmyw/maYMZj8CBQAJ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-performance Perf of queries or internals. Solution not expected to change functional behavior.
Projects
None yet
Development

No branches or pull requests

5 participants