Click the button of "Projects -- List" and the results return take a few time!

105 views
Skip to first unread message

vista...@gmail.com

unread,
Apr 7, 2018, 9:25:05 PM4/7/18
to Repo and Gerrit Discussion
Hi all:
       Something very strange is happening in my gerrit.
       Some accounts click the button of "Projects -- List" and "People -- List Groups"  and the results return take a few time about 5-10s,but 1-5s for other accounts.
What is the problem?

Thanks!

vista...@gmail.com

unread,
Apr 8, 2018, 11:37:18 AM4/8/18
to Repo and Gerrit Discussion
And the number of Git Projects : about 10000. 

vista...@gmail.com

unread,
Apr 8, 2018, 1:21:23 PM4/8/18
to Repo and Gerrit Discussion
There is a bug in  gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java

Any account click the button of "Projects -- List" and all of GitProjects in gerrit will be scaned one time which right permissions for the accounts.

Jonathan Nieder

unread,
Apr 8, 2018, 8:56:57 PM4/8/18
to vista...@gmail.com, Repo and Gerrit Discussion
What version of Gerrit are you using?

вс, 8 апр. 2018 г. в 10:21, <vista...@gmail.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.
For more options, visit https://groups.google.com/d/optout.

vista...@gmail.com

unread,
Apr 9, 2018, 2:53:05 AM4/9/18
to Repo and Gerrit Discussion
gerrit version:2.13.7

Luca Milanesio

unread,
Apr 9, 2018, 3:10:03 AM4/9/18
to vista...@gmail.com, Luca Milanesio, Repo and Gerrit Discussion

On 8 Apr 2018, at 18:21, vista...@gmail.com wrote:

There is a bug in  gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java

Any account click the button of "Projects -- List" and all of GitProjects in gerrit will be scaned one time which right permissions for the accounts.

If projects cache is full, the scanning of 10k in memory should take a small fraction of a second: 10s CPU time is *a lot* for scanning 10k objects in memory.
Can you check your cache configs (gerrit.config / [cache "<something>"]) ?

The default cache size is 1024 and, if you haven't customised anything about caching on your gerrit.config, it could be the reason why the scanning takes so long.

Luca.


On Sunday, April 8, 2018 at 11:37:18 PM UTC+8, vista...@gmail.com wrote:
And the number of Git Projects : about 10000. 

On Sunday, April 8, 2018 at 9:25:05 AM UTC+8, vista...@gmail.com wrote:
Hi all:
       Something very strange is happening in my gerrit.
       Some accounts click the button of "Projects -- List" and "People -- List Groups"  and the results return take a few time about 5-10s,but 1-5s for other accounts.
What is the problem?

Thanks!

vista...@gmail.com

unread,
Apr 9, 2018, 4:58:10 AM4/9/18
to Repo and Gerrit Discussion
And the number of Git Projects is about 10000

What can be configed for [cache "projects"] and now default cache size is 1024.


On Monday, April 9, 2018 at 3:10:03 PM UTC+8, lucamilanesio wrote:

On 8 Apr 2018, at 18:21, vista...@gmail.com wrote:

There is a bug in  gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java

Any account click the button of "Projects -- List" and all of GitProjects in gerrit will be scaned one time which right permissions for the accounts.

If projects cache is full, the scanning of 10k in memory should take a small fraction of a second: 10s CPU time is *a lot* for scanning 10k objects in memory.
Can you check your cache configs (gerrit.config / [cache "<something>"]) ?

The default cache size is 1024 and, if you haven't customised anything about caching on your gerrit.config, it could be the reason why the scanning takes so long.

Luca.


On Sunday, April 8, 2018 at 11:37:18 PM UTC+8, vista...@gmail.com wrote:
And the number of Git Projects : about 10000. 

On Sunday, April 8, 2018 at 9:25:05 AM UTC+8, vista...@gmail.com wrote:
Hi all:
       Something very strange is happening in my gerrit.
       Some accounts click the button of "Projects -- List" and "People -- List Groups"  and the results return take a few time about 5-10s,but 1-5s for other accounts.
What is the problem?

Thanks!

--
--

Luca Milanesio

unread,
Apr 9, 2018, 5:00:26 AM4/9/18
to vista...@gmail.com, Luca Milanesio, Repo and Gerrit Discussion
If you have 1024 as projects cache ... whilst you have in reality 10k ... I am not surprised that is quite slow :-)
Just amend the value with a value that is over the maximum number of projects you have.

Luca.

vista...@gmail.com

unread,
Apr 9, 2018, 5:05:32 AM4/9/18
to Repo and Gerrit Discussion
Thank you very much!

vista...@gmail.com

unread,
Apr 14, 2018, 4:21:35 AM4/14/18
to Repo and Gerrit Discussion
[cache "projects"]
        maxAge = 30s
        loadOnStartup = true
        memoryLimit = 20000


Also quite slow! :-(


The results of gerrit show-caches 






On Monday, April 9, 2018 at 5:00:26 PM UTC+8, lucamilanesio wrote:

Matthias Sohn

unread,
Apr 14, 2018, 7:44:30 PM4/14/18
to vista...@gmail.com, Repo and Gerrit Discussion
On Sat, Apr 14, 2018 at 10:21 AM, <vista...@gmail.com> wrote:
[cache "projects"]
        maxAge = 30s
        loadOnStartup = true
        memoryLimit = 20000


Also quite slow! :-(

 why do you expire entries in projects cached already after 30sec ?
This means Gerrit has to scan the file system for git repositories every
30 seconds to rediscover all the repositories under the folder at hand.

 

--
--
To unsubscribe, email repo-discuss+unsubscribe@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+unsubscribe@googlegroups.com.

Remy Bohmer

unread,
Apr 15, 2018, 2:07:11 AM4/15/18
to vista...@gmail.com, Repo and Gerrit Discussion
Hi,

The screenshot of show-caches still shows 1024 as cache size. After changing such settings you need to restart Gerrit.

Kind regards,

Remy

Op za 14 apr. 2018 10:21 schreef <vista...@gmail.com>:
To unsubscribe, email repo-discuss...@googlegroups.com

vista...@gmail.com

unread,
Apr 15, 2018, 7:14:14 PM4/15/18
to Repo and Gerrit Discussion
Hi,Matthias Sohn.

    This is for the new projects.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com

vista...@gmail.com

unread,
Apr 15, 2018, 7:25:49 PM4/15/18
to Repo and Gerrit Discussion

Sorry,the screenshot is wrong,I upload the new one.

Matthias Sohn

unread,
Apr 15, 2018, 8:00:46 PM4/15/18
to vista...@gmail.com, Repo and Gerrit Discussion
 
On Sunday, April 15, 2018 at 7:44:30 AM UTC+8, Matthias Sohn wrote:
On Sat, Apr 14, 2018 at 10:21 AM, <vista...@gmail.com> wrote:
[cache "projects"]
        maxAge = 30s
        loadOnStartup = true
        memoryLimit = 20000


Also quite slow! :-(

 why do you expire entries in projects cached already after 30sec ?
This means Gerrit has to scan the file system for git repositories every
30 seconds to rediscover all the repositories under the folder at hand.

 
On Mon, Apr 16, 2018 at 1:14 AM, <vista...@gmail.com> wrote:
Hi,Matthias Sohn.

    This is for the new projects.

please avoid top posting on this list

ok, but documentation [1] says :
"Entries are removed from the cache and refreshed from source data every maxAge interval"
this means that if a project isn't used for 30 seconds it's evicted from the cache and if you need
if after 31 sec you'll have to wait for a new scan. Scans are expensive especially if your site
is large. We have set checkFrequency to "off".

Newly inserted projects should not require flushing the corresponding caches but should read
as soon they are read:

cache "projects"

Caches the project description records, from the projects table in the database. If a project record is updated or deleted, this cache should be flushed. Newly inserted projects do not require a cache flush, as they will be read upon first reference.

-Matthias



 

--
--
To unsubscribe, email repo-discuss+unsubscribe@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+unsubscribe@googlegroups.com.

vista...@gmail.com

unread,
Apr 16, 2018, 4:55:56 AM4/16/18
to Repo and Gerrit Discussion
Thank you very much!
Reply all
Reply to author
Forward
0 new messages