commit | e0ca3d1a804c8cf8463eff1671032745ba66fb5e | [log] [tgz] |
---|---|---|
author | Jacek Centkowski <geminica.programs@gmail.com> | Sun May 01 14:21:31 2022 +0100 |
committer | Jacek Centkowski <geminica.programs@gmail.com> | Tue May 24 08:31:39 2022 +0200 |
tree | 07fb705722c2a631659a10f2d3a04f94de65654e | |
parent | bd3ecf87b2c65ac39392eebd70b96e6d9ff9a0d2 [diff] |
Avoid full cache scanning for pruning The full cache scanning should be avoided at all costs because of the massive CPU and JVM heap utilisation due to the deserialisation of the cached values. The prune() of the cache cannot rely on any ordering of entries and therefore needs another data structure to remember the historical insertion ordering of the keys. Use an in-memory linked hash set so that MRU keys are propagated by remove-add on each key access to the tail of it whereas LRU key is always available as a head key (therefore it is cheap to remove LRU keys). In addition to key store also the value insertion time so that expiring entries for maxAge is also possible. TODO: The queue is currently in memory which isn't going to work across restarts. The queue needs to be persisted to disk as a circular file with automatic reorganiation. Bug: Issue 15121 Change-Id: Ifa3068e2d27713b452c4bcab6a611e3c9b511868
Non-blocking and super-fast on-disk cache libModule for Gerrit Code Review based on ChronicleMap on-disk implementation.
This libModule is built like a Gerrit in-tree plugin, using Bazelisk. See the build instructions for more details.
Install the chronicle-map module into the $GERRIT_SITE/lib
directory.
Add the cache-chroniclemap module to $GERRIT_SITE/etc/gerrit.config
as follows:
[gerrit] installModule = com.googlesource.gerrit.modules.cache.chroniclemap.ChronicleMapCacheModule
For further information and supported options, refer to config documentation.
You can check how to migrate from H2 to chronicle-map here.