commit | 6a90f9fd5f2f620affcd9116cd148fcfd5fffcf6 | [log] [tgz] |
---|---|---|
author | Luca Milanesio <luca.milanesio@gmail.com> | Thu Sep 16 21:04:17 2021 +0100 |
committer | Luca Milanesio <luca.milanesio@gmail.com> | Fri Oct 01 00:13:10 2021 +0100 |
tree | 9eb0cf6d8aed7cfcde391aeed394f2d24f187c4b | |
parent | c0ccaf143d12d1000443217f5d9a2efdaa3e849f [diff] |
Front CacheChronicleMap with a Guava cache The initial implementation of persistent caches using ChronicleMap did not use any Guava cache front-end, relying on the speed of accessing data on disk and memory. Unfortunately, the deserialisation of some entities (e.g. change_notes) is very expensive in terms of CPU and ChronicleMap does not store the binary objects as-is but relies on in-memory serialisation of keys and values. There are two problems caused by this: - delay in reading the cache from memory - high system load when accessing the cache Use the same structure of the H2 persistent cache where the loader is delegated to the retrieval and deserialisation of the entities from ChronicleMap. Amend the cache statistics and return the in-memory elements and the ones stored on disk as separate values. Bug: Issue 15036 Change-Id: I8dd602c20fcd621972b562fc2163fefc7240484a
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.