[pybsddb] Transactions

Matt Chaput matt at whoosh.ca
Thu Jan 16 22:22:00 CET 2014


On Jan 16, 2014, at 3:24 PM, Ryan Olf <ryan at efrus.com> wrote:

> I don't have any experience with _DBWithCursor, and I haven't really done extensive testing of my setup, so I'd be interested to know what you learn about this use-case, as it's similar to mine. To allow multiple access, I'm opening a dbenv with these flags:
> 
> db.DB_CREATE | db.DB_INIT_MPOOL | db.DB_INIT_TXN | db.DB_INIT_LOG | db.DB_INIT_LOCK
> 
> And then adding the flag: db.DB_TXN_NOWAIT

Thanks for replying :)

I added DB_TXN_NOWAIT as well as DB_TXN_WRITE_NOSYNC, neither made any difference, or else slowed it down even more, since it was 100x slower than bsddb3.btopen() the next time I checked :/

However, I tried setting the cache to 4MB and that fixed the problem! Or at least masked the problem ;). It’s now roughly the same speed (slightly faster) as the object returned by bsddb3.btopen().

In the end, these are my DBEnv flags:

db.DB_INIT_TXN
| db.DB_INIT_LOCK
| db.DB_INIT_MPOOL
| db.DB_PRIVATE
| db.DB_TXN_NOWAIT
| db.DB_TXN_NOSYNC
| db.DB_TXN_WRITE_NOSYNC

Hopefully those are reasonable (I don’t care about recovery, and use only one env per-thread). I’m pretty much trial-and-erroring this thing ;)

Cheers,

Matt



More information about the pybsddb mailing list