From d967ec4aa9c3485d269b79e5ed776b6281595f14 Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Mon, 13 Nov 2017 15:14:41 +0100 Subject: [PATCH] Make the group caches unlimited by default The group caches should be large enough to hold entries for all internal groups otherwise overall Gerrit performance may be poor. Make the group caches unlimited by default and add a note to the documentation. Change-Id: Ieef38b9dda71bf8c7174c1030e069037721f38c8 Signed-off-by: Edwin Kempin --- Documentation/config-gerrit.txt | 18 ++++++++++++++++++ .../gerrit/server/account/GroupCacheImpl.java | 3 +++ 2 files changed, 21 insertions(+) diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt index 2903bfdce3..73fd687b39 100644 --- a/Documentation/config-gerrit.txt +++ b/Documentation/config-gerrit.txt @@ -740,6 +740,9 @@ Default is 1024 for most caches, except: * `"diff"`: default is `10m` (10 MiB of memory) * `"diff_intraline"`: default is `10m` (10 MiB of memory) * `"diff_summary"`: default is `10m` (10 MiB of memory) +* `"groups"`: default is unlimited +* `"groups_byname"`: default is unlimited +* `"groups_byuuid"`: default is unlimited * `"plugin_resources"`: default is 2m (2 MiB of memory) + @@ -844,6 +847,11 @@ cache `"groups"`:: Caches the basic group information of internal groups by group ID, including the group owner, name, and description. + +For this cache it is important to configure a size that is larger than +the number of internal Gerrit groups, otherwise general Gerrit +performance may be poor. This is why by default this cache is +unlimited. ++ External group membership obtained from LDAP is cached under `"ldap_groups"`. @@ -852,6 +860,11 @@ cache `"groups_byname"`:: Caches the basic group information of internal groups by group name, including the group owner, name, and description. + +For this cache it is important to configure a size that is larger than +the number of internal Gerrit groups, otherwise general Gerrit +performance may be poor. This is why by default this cache is +unlimited. ++ External group membership obtained from LDAP is cached under `"ldap_groups"`. @@ -860,6 +873,11 @@ cache `"groups_byuuid"`:: Caches the basic group information of internal groups by group UUID, including the group owner, name, and description. + +For this cache it is important to configure a size that is larger than +the number of internal Gerrit groups, otherwise general Gerrit +performance may be poor. This is why by default this cache is +unlimited. ++ External group membership obtained from LDAP is cached under `"ldap_groups"`. diff --git a/java/com/google/gerrit/server/account/GroupCacheImpl.java b/java/com/google/gerrit/server/account/GroupCacheImpl.java index 4bc8e64892..4783f2993a 100644 --- a/java/com/google/gerrit/server/account/GroupCacheImpl.java +++ b/java/com/google/gerrit/server/account/GroupCacheImpl.java @@ -52,12 +52,15 @@ public class GroupCacheImpl implements GroupCache { @Override protected void configure() { cache(BYID_NAME, AccountGroup.Id.class, new TypeLiteral>() {}) + .maximumWeight(Long.MAX_VALUE) .loader(ByIdLoader.class); cache(BYNAME_NAME, String.class, new TypeLiteral>() {}) + .maximumWeight(Long.MAX_VALUE) .loader(ByNameLoader.class); cache(BYUUID_NAME, String.class, new TypeLiteral>() {}) + .maximumWeight(Long.MAX_VALUE) .loader(ByUUIDLoader.class); bind(GroupCacheImpl.class);