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

Investigate potential lock contention in DBImpl::WriteImpl when writing to the PartitionStore #1891

Open
Tracked by #1870
tillrohrmann opened this issue Aug 26, 2024 · 1 comment

Comments

@tillrohrmann
Copy link
Contributor

tillrohrmann commented Aug 26, 2024

While benchmarking Restate, I noticed that we spend a lot of time in rocksd::DBImpl::WriteImpl when trying to commit the PartitionStoreTransaction from the different partition processors. I suspect that this might be cause by lock contention. Unfortunately, the flamegraphs on MacOS don't give more insights.

The results of throughput/parallel with main 361e6a8 were:

throughput/parallel     time:   [397.84 ms 412.47 ms 426.13 ms]
                        thrpt:  [9.3868 Kelem/s 9.6976 Kelem/s 10.054 Kelem/s]

flamegraph

@tillrohrmann
Copy link
Contributor Author

tillrohrmann commented Aug 27, 2024

I've tried a simple experiment where every PartitionStore gets its own RocksDB instance to avoid contention completely. The results of the throughput/parallel benchmark are:

throughput/parallel     time:   [354.54 ms 359.25 ms 364.08 ms]
                        thrpt:  [10.986 Kelem/s 11.134 Kelem/s 11.282 Kelem/s]

and the flamegraph no longer shows time spent on awaiting the lock when writing to the PartitionStore (DBImpl::WriteImpl):

flamegraph

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

No branches or pull requests

1 participant