Limit recent activity widget data to 1000
Summary
As part of load reducing initiative we should consider changing "Recent activity" widget to be faster. Currently it calculates number of recently created issues, MRs and added users. Corresponding queries load way too much data which leads to slow queries or even timeouts for large groups.
Here is my couple assumptions on "recent activity" widget.
- Main use case is to estimate how active is an open sourced public project. Not that useful for private projects since those are not publicly visible.
- Exact number doesn't matter much. Degree of activity is what that matters.
Suggestion
Limit counters to 1000. So if a group has 1000 or more recent issues we can display "1000+". Same for MRs and members added.
-
frontend add a limit param to the API calls for 1001 records. If the value returned from the API = the limit, display the limit value minus 1 and a '+' i.e. if the limit is 1001 display
1000+
. Add a tooltip which says "More than 1,000". - backend add the limiting functionality to the API
Expected impact
According to #database-lab tests this change will reduce the load roughly 5 times for large groups.
Edited by Brandon Labuschagne