]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
cache: rework reusing transactions (LMDB)
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 1 Sep 2017 13:33:30 +0000 (15:33 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 1 Sep 2017 14:17:49 +0000 (16:17 +0200)
commite2621d928e4e9a61fac488d0278bb593cfdfb656
tree0aeda08b37f32717b43e0ad50f24c946f53e61f8
parent536fa6106767db144dec6342afbb8ef9528ae7cd
cache: rework reusing transactions (LMDB)

Previously a read transaction could be held open by each fork
indefinitely.  That was done for better speed, but it had a downside
of keeping old pages alive and potentially reading only old data,
until some writes were attempted by that fork.

Now kr_cache_ provides explicit API for suitable points where to break
transactions, reusing the _sync command.  On LMDB side the read-only
transaction is only reset and later renewed, supposedly giving better
performance than aborting (see LMDB docs on reset+renew).

Performance: preliminary testing with two forks, resperf on comcast
query-set shows no noticeable difference in peak QPS.
daemon/bindings.c
lib/cache.c
lib/cache.h
lib/cdb.h
lib/cdb_lmdb.c
lib/layer/pktcache.c
lib/layer/rrcache.c
lib/resolve.c
lib/zonecut.c
tests/test_cache.c