Increase size limits for some Gerrit caches

When we restarted Gerrit recently there were a number of caches that
were over their default max sizes so were pruned. Gerrit prunes daily at
0100 or when restarted. This gives us a good indication for which caches
are currently configured to be too small for typically operation as we
restarted several hours before 0100.

All of the logged cache pruning can be found in this paste [0]. Many of
these caches were floating around their configured maximum and we leave
them alone. However four related caches are well above their default max
which is a good indication we need to increase their sizes. The four are
identified below with their documented purpose/function from the
upstream docs [1]:

 * cache "git_modified_files"
   Each item caches the list of git modified files between two git trees
   corresponding to two different commits. This cache does not read the
   actual file contents nor does it include the edits (modified regions)
   of the files.

 * cache "modified_files"
   Each item caches the list of modified files between two commits. This
   cache is similar to the git_modified_files cache but performs extra
   logic including filtering out files that are untouched by both
   commits because they were purely modified between the parent commits.

 * cache "git_file_diff"
   Each item caches the pure git diff between two git trees for a
   specific file path. The diff includes all the file attributes
   (old/new paths, change/patch types) as well as the list of edits
   corresponding to the modified regions in the file.

 * cache "gerrit_file_diff"
   Each item caches the diff between two git commits for a specific file
   path. This cache is similar to the git_file_diff cache but performs
   extra logic including identifying the edits that are due to rebase.
   The diff for the "commit message" and "merge list" can also be
   requested from this cache.

   Entries in this cache are relatively large, so memoryLimit is an
   estimate in bytes of memory used. Administrators should try to target
   cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
   day span. The same applies for other diff caches:
   "git_modified_files", "modified_files" and "git_file_diff".

The note at the end of cache "gerrit_file_diff" is what we use to
determine these new sizes though we're more conservative with the memory
limits (default of which is 10m for each of these caches) as memory is
more scarce than disk.

[0] https://paste.opendev.org/show/bk4pTIuQLCsWaF3dVVF7/
[1] https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#cache

Change-Id: I521b53c130892fc2152586da1c4858ea4099479f
This commit is contained in:
Clark Boylan 2024-10-18 13:41:16 -07:00
parent 440ddedfea
commit 046aad9276

View File

@ -82,6 +82,18 @@
memoryLimit = 4096
[cache "web_sessions"]
maxAge = 7days
[cache "git_modified_files"]
memoryLimit = 128m
diskLimit = 512m
[cache "modified_files"]
memoryLimit = 128m
diskLimit = 512m
[cache "git_file_diff"]
memoryLimit = 256m
diskLimit = 2g
[cache "gerrit_file_diff"]
memoryLimit = 256m
diskLimit = 3g
# Set to @openstack.org because @opendev.org lacks a valid MX
[user]
email = review@openstack.org