cberner / redb

An embedded key-value database in pure Rust
https://www.redb.org
Apache License 2.0
3.07k stars 137 forks source link

begin_write() after commit() is very slow, even with Durability::Eventual #820

Closed W4G1 closed 2 weeks ago

W4G1 commented 2 weeks ago

Starting a new write transaction with Database.begin_write() directly after a previous one finished with WriteTransaction.commit() takes about 1-2 seconds. I initially thought this had something to do with the default durability, but even when using Durability Eventual or None, it's still very slow.

cberner commented 2 weeks ago

Can you send an example that reproduces the issue? I've never seen that before

W4G1 commented 2 weeks ago

I found the problem. I had the previous write tx open for too long because there was also some other intensive process in between, which is why the next write tx had to wait 1-2s. When I removed this in-between process then consecutive write transactions were fast again.

Sorry for the false positive :)