dashboard icon indicating copy to clipboard operation
dashboard copied to clipboard

Side Menu Cluster List performance badly at scale

Open richard-cox opened this issue 1 year ago • 3 comments

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
    • image
  • Of the 3 seconds process we spend over 1 second in a top level menu computed property clusters
    • image
  • In clusters we 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 map the 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

richard-cox avatar Sep 23 '24 14:09 richard-cox

/backport v2.9.3

richard-cox avatar Sep 24 '24 17:09 richard-cox

Note - https://github.com/rancher/dashboard/pull/11998 contains a 2.9.3 fix

richard-cox avatar Sep 26 '24 16:09 richard-cox

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.

richard-cox avatar Oct 11 '24 09:10 richard-cox

Part of tests done in https://github.com/rancher/dashboard/issues/11995

Rancher version: 2.10.0-alpha6 UI version: v2.10.0-alpha4 Rancher repro version: 2.9.1 k8s 1.29 as HA with 3 all roles t3a.xlarge nodes. Cluster count: 701 (includes local) Browser: 130.0.6723.92 (Official Build) (arm64) (To utilize the performance tools). Cache disabled. Server-side Pagination: Disabled

The performance on 2.10.0 is noticeable. On 2.9.1 the home page loaded in not less that ~45 seconds and not completing the Cluster list rendering.

On 2.10.0 the loading times where consistent at around 5 seconds and the Cluster list was rendered properly and paginated as expected.

2.9.1:

Screenshot 2024-11-04 at 11 32 04

2.10.0:

Screenshot 2024-11-04 at 11 57 01

izaac avatar Nov 04 '24 19:11 izaac