Side Menu Cluster List performance badly at scale
SURE-7040
Setup
- Rancher version: 2.9.1 (and before)
Describe the bug
- When there are lots of clusters (~700) logging in takes a number of seconds
- Some of this is generic processing of a large number of resources (objectify, cache, etc), however some specific to the top level menu
- Once the resources are fetched we spend ~3 seconds processing resources
- Of the 3 seconds process we spend over 1 second in a top level menu computed property
clusters - In
clusterswe iterate over all clusters a number of times. We also convert them to an object ready to show on screen. - This will in theory go away with vai (we shouldn't ever fetch that many resources). Until then...
- Suggestion 1
- recreating the issue
- only
mapthe objects we're going to show on screen, this could be a very small number - attempt to reproduce with fix
- Suggestion 2
- less loops!
Note - clusters runs often, perhaps on cluster state change? each time it consumes over second of cpu
To Reproduce
- Load ~700 clusters (they could be RKE2 Custom)
- refresh on login page
- log in
Result
- should in theory be a large time spent in
clusters
Expected Result
- almost no time in `clusters
Additional context
- If vai changes have merged this file will have already been reworked
/backport v2.9.3
Note - https://github.com/rancher/dashboard/pull/11998 contains a 2.9.3 fix
Release Note (combined with https://github.com/rancher/dashboard/issues/11995)
The performance of the Clusters lists in the Home page and the Side Menu has greatly improved when there hundreds of clusters.
Part of tests done in https://github.com/rancher/dashboard/issues/11995
Rancher version:
2.10.0-alpha6UI version:v2.10.0-alpha4Rancher repro version:2.9.1k8s1.29asHAwith 3 all rolest3a.xlargenodes. Cluster count:701(includes local) Browser:130.0.6723.92 (Official Build) (arm64)(To utilize the performance tools). Cache disabled. Server-side Pagination:DisabledThe performance on
2.10.0is noticeable. On2.9.1the home page loaded in not less that ~45 seconds and not completing the Cluster list rendering.On
2.10.0the loading times where consistent at around 5 seconds and the Cluster list was rendered properly and paginated as expected.
2.9.1:![]()
2.10.0:![]()