What's the default value of cache.change_notes?

81 views
Skip to first unread message

Yingchun Li

unread,
Jun 19, 2025, 7:40:53 AM6/19/25
to Repo and Gerrit Discussion
Hi,
    When I using `ssh xxx gerrit show-caches`, s, I noticed a very low cache hit ratio for change_notes:

ssh -p 29418 localhost gerrit show-caches
Gerrit Code Review        3.10.5                    now    11:10:21   UTC
                                                 uptime   11 days  6 hrs

  Name                          |Entries              |  AvgGet |Hit Ratio|
                                |   Mem   Disk   Space|         |Mem  Disk|
--------------------------------+---------------------+---------+---------+
  adv_bases                     |                     |         | 93%     |
  change_notes                  |   147               | 610.7us | 20%     |
...
    However, I couldn't find the default value for change_notes in the documentation and am unsure how to set this value. Could you please provide some advice?
   Thanks.
Br,
Yingchun 

Nasser Grainawi

unread,
Jun 19, 2025, 12:32:33 PM6/19/25
to Yingchun Li, Repo and Gerrit Discussion
Sorry that's missing from the docs, I'll get that added today. The default is 10MiB for the memory limit and by default the disk cache is disabled. The sizing is based on the size of each ChangeNotes object, which varies based on the size of the change (# of patch sets, # of reviewers, # of comments, etc). I would recommend the memoryLimit of this cache should be set large enough to at least fit all changes being accessed (via web UI, SSH/REST APIs, and git) concurrently. That will help ensure there are no scenarios where a cache entry is loaded and then evicted before a single request is completed. If you want to use some disk space, you could set the diskLimit to something larger than the memoryLimit and that will help for cases where other recently loaded changes are accessed again.

Nasser
 
   Thanks.
Br,
Yingchun 

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/2cedbeec-d6d3-466d-bece-62ef86c62a5cn%40googlegroups.com.

Yingchun Li

unread,
Jun 19, 2025, 11:16:46 PM6/19/25
to Repo and Gerrit Discussion
On Friday, June 20, 2025 at 12:32:33 AM UTC+8 Nasser Grainawi wrote:
On Thu, Jun 19, 2025 at 5:40 AM Yingchun Li <sword.l...@gmail.com> wrote:
Hi,
    When I using `ssh xxx gerrit show-caches`, s, I noticed a very low cache hit ratio for change_notes:

ssh -p 29418 localhost gerrit show-caches
Gerrit Code Review        3.10.5                    now    11:10:21   UTC
                                                 uptime   11 days  6 hrs

  Name                          |Entries              |  AvgGet |Hit Ratio|
                                |   Mem   Disk   Space|         |Mem  Disk|
--------------------------------+---------------------+---------+---------+
  adv_bases                     |                     |         | 93%     |
  change_notes                  |   147               | 610.7us | 20%     |
...
    However, I couldn't find the default value for change_notes in the documentation and am unsure how to set this value. Could you please provide some advice?

Sorry that's missing from the docs, I'll get that added today. The default is 10MiB for the memory limit and by default the disk cache is disabled. The sizing is based on the size of each ChangeNotes object, which varies based on the size of the change (# of patch sets, # of reviewers, # of comments, etc). I would recommend the memoryLimit of this cache should be set large enough to at least fit all changes being accessed (via web UI, SSH/REST APIs, and git) concurrently. That will help ensure there are no scenarios where a cache entry is loaded and then evicted before a single request is completed. If you want to use some disk space, you could set the diskLimit to something larger than the memoryLimit and that will help for cases where other recently loaded changes are accessed again.

There are other entries dont have default value:conflicts, mergeability, change_kind.Thanks a lot.

Matthias Sohn

unread,
Jun 20, 2025, 3:44:24 AM6/20/25
to Yingchun Li, Repo and Gerrit Discussion
On Fri, Jun 20, 2025 at 5:16 AM Yingchun Li <sword.l...@gmail.com> wrote:


On Friday, June 20, 2025 at 12:32:33 AM UTC+8 Nasser Grainawi wrote:
On Thu, Jun 19, 2025 at 5:40 AM Yingchun Li <sword.l...@gmail.com> wrote:
Hi,
    When I using `ssh xxx gerrit show-caches`, s, I noticed a very low cache hit ratio for change_notes:

ssh -p 29418 localhost gerrit show-caches
Gerrit Code Review        3.10.5                    now    11:10:21   UTC
                                                 uptime   11 days  6 hrs

  Name                          |Entries              |  AvgGet |Hit Ratio|
                                |   Mem   Disk   Space|         |Mem  Disk|
--------------------------------+---------------------+---------+---------+
  adv_bases                     |                     |         | 93%     |
  change_notes                  |   147               | 610.7us | 20%     |
...
    However, I couldn't find the default value for change_notes in the documentation and am unsure how to set this value. Could you please provide some advice?

Sorry that's missing from the docs, I'll get that added today. The default is 10MiB for the memory limit and by default the disk cache is disabled. The sizing is based on the size of each ChangeNotes object, which varies based on the size of the change (# of patch sets, # of reviewers, # of comments, etc). I would recommend the memoryLimit of this cache should be set large enough to at least fit all changes being accessed (via web UI, SSH/REST APIs, and git) concurrently. That will help ensure there are no scenarios where a cache entry is loaded and then evicted before a single request is completed. If you want to use some disk space, you could set the diskLimit to something larger than the memoryLimit and that will help for cases where other recently loaded changes are accessed again.

There are other entries dont have default value:conflicts, mergeability, change_kind.Thanks a lot.

Default is 1024 for most caches, except:
  • "adv_bases": default is 4096

  • "git_modified_files": default is 10m (10 MiB of memory)
    ...

Default is 128 MiB per cache, except:
  • "change_notes": disk storage is disabled by default

  • "diff_summary": default is 1g (1 GiB of disk space)
    ...

 
Nasser
 
   Thanks.
Br,
Yingchun 

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/2cedbeec-d6d3-466d-bece-62ef86c62a5cn%40googlegroups.com.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Yingchun Li

unread,
Jun 23, 2025, 1:53:04 AM6/23/25
to Repo and Gerrit Discussion
On Friday, June 20, 2025 at 3:44:24 PM UTC+8 Matthias Sohn wrote:
On Fri, Jun 20, 2025 at 5:16 AM Yingchun Li <sword.l...@gmail.com> wrote:


On Friday, June 20, 2025 at 12:32:33 AM UTC+8 Nasser Grainawi wrote:
On Thu, Jun 19, 2025 at 5:40 AM Yingchun Li <sword.l...@gmail.com> wrote:
Hi,
    When I using `ssh xxx gerrit show-caches`, s, I noticed a very low cache hit ratio for change_notes:

ssh -p 29418 localhost gerrit show-caches
Gerrit Code Review        3.10.5                    now    11:10:21   UTC
                                                 uptime   11 days  6 hrs

  Name                          |Entries              |  AvgGet |Hit Ratio|
                                |   Mem   Disk   Space|         |Mem  Disk|
--------------------------------+---------------------+---------+---------+
  adv_bases                     |                     |         | 93%     |
  change_notes                  |   147               | 610.7us | 20%     |
...
    However, I couldn't find the default value for change_notes in the documentation and am unsure how to set this value. Could you please provide some advice?

Sorry that's missing from the docs, I'll get that added today. The default is 10MiB for the memory limit and by default the disk cache is disabled. The sizing is based on the size of each ChangeNotes object, which varies based on the size of the change (# of patch sets, # of reviewers, # of comments, etc). I would recommend the memoryLimit of this cache should be set large enough to at least fit all changes being accessed (via web UI, SSH/REST APIs, and git) concurrently. That will help ensure there are no scenarios where a cache entry is loaded and then evicted before a single request is completed. If you want to use some disk space, you could set the diskLimit to something larger than the memoryLimit and that will help for cases where other recently loaded changes are accessed again.

There are other entries dont have default value:conflicts, mergeability, change_kind.Thanks a lot.

Default is 1024 for most caches, except:
  • "adv_bases": default is 4096

  • "git_modified_files": default is 10m (10 MiB of memory)
    ...

for the conflicts and mergeaboility, they are seems not 1024(maybe also 10 MB), 
...
D conflicts                     | 37400 949413 128.91m|  61.1ms | 51%  99%|
...
D mergeability                  |  8738 115354  17.63m|  60.6ms | 54%  82%|
 ...
conflicts is 37400, I am sure I am using the default setting for these two cache.

Matthias Sohn

unread,
Jun 23, 2025, 2:15:03 AM6/23/25
to Yingchun Li, Repo and Gerrit Discussion

Yingchun Li

unread,
Jun 23, 2025, 5:54:35 AM6/23/25
to Repo and Gerrit Discussion
Nasser, Matthias, Thank you !
Reply all
Reply to author
Forward
0 new messages