nickva commented on PR #5625:
URL: https://github.com/apache/couchdb/pull/5625#issuecomment-3212432680
I made two more improvements inspired by some discussions with Mike and Bob:
* Added a priority field to the insert call. So the depth 1 nodes get a
higher initial priority. Priority higher than 1 is basically the initial usage
count, so the entry would survive a few more cleanup intervals.
* When b-trees are updated there is an effect that a root node that was in
use would now become abandoned suddenly. To help evict it faster, since we know
how the b-tree get updated, we can reset its usage count to 0 (not remove it
because some clients may still be reading from the old snapshot, otherwise the
entry stays at least until the next cleanup interval but no more than that)
* If the cache is not very full previously we just leave the entries in
there case they may be reused if there is no pressure on the cache. However
with a longer interval of 1-2 seconds a new set of updates would be prevented
from using the cache for a bit. So the change is that now if we didn't do any
cleanup (we're half empty) then instead of sleeping for 1-2 seconds we checking
the cache size every few hundred milliseconds, so we can react faster to new
entries wanting to use the cache
* To avoid the cache users all calling is_process_alive(Fd), which is
still a process signal send/receive I made the cleaner processes do it
periodically. They gather the processes in a set then delete the dead ones,
that gets the send/recv signal path out of main data path.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]