As per the recent discussion on the mailing list. Using mutexes in TDB instead of fcntl locks noticeably reduces CPU resource usage (as seen in perf profiling).
Created attachment 13372 [details] Patches for v4-7
Reassigning to Karolin for inclusion in 4.7.
The fix has a bug. It causes recursion since the persistent flag calculation is wrong.
Created attachment 13407 [details] Patches for v4-7
(In reply to Ralph Böhme from comment #5) Pushed to autobuild-v4-7-test.
(In reply to Karolin Seeger from comment #6) Pushed to v4-7-test. Closing out bug report. Thanks!