apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.11k stars 1.11k forks source link

Project Dropdown in Dashboard takes minutes to load #9679

Closed btzq closed 1 month ago

btzq commented 2 months ago
ISSUE TYPE
COMPONENT NAME
UI
CLOUDSTACK VERSION
4.19.1.1
CONFIGURATION
OS / ENVIRONMENT
SUMMARY

When logging in as Admin, Domain Admin or User, when clicking on the Project Drop down, it doesnt display info at first.

Screenshot 2024-09-13 at 9 15 21 PM

It shows 0 for a long time (around 30s-1min) in order for the project list to be fully loaded.

But after loading, if you click on the dropdown again, it shows 0 again.

STEPS TO REPRODUCE
1. Login to Cloudstack Dashboard
2. Select 'Project' dropdown
3. Notice it display 0 and No Data
4. Wait for 30s-1min and the project list will be loaded
EXPECTED RESULTS
Project Dropdown to load faster (eg. 1-3 seconds)
ACTUAL RESULTS
Project Dropdown takes 30s-1min to load
DaanHoogland commented 2 months ago

@btzq , how many projects and project members do you have?

btzq commented 2 months ago

@btzq , how many projects and project members do you have?

Only around 20 Projects. I dont think its alot. As for accounts, you can assume 1 Account for 1 Project.

DaanHoogland commented 2 months ago

@btzq I tried to reproduce it but my list filles within a second, of course this is a lab enironment so extra conditions may be needed to reproduce this. Our dev-lab has 72 projects atm and is very dynamically changing this number. It also has no problems displaying the dropdown within a second in a new private window. The logging on process takes more time so not disturbing at all. I think you'll need to investigate more.

btzq commented 2 months ago

@DaanHoogland ive recorded a video of what im seeing.

https://github.com/user-attachments/assets/c13ad4be-017a-4a35-b6e1-cd7ada099ecb

Notice That:

Strangely, our login process is very fast. No lags there.

Just the Project Dropdown is slow.

Which version are you using? Could it be you guys are using a newer version that has this issue resolved?

DaanHoogland commented 2 months ago

Which version are you using? Could it be you guys are using a newer version that has this issue resolved?

4.19.1.0-SNAPSHOT it is from just before the 4.19.1 release, I'll update it and try again. I do see the same as you but for less than a second.

DaanHoogland commented 2 months ago

now tried 4.19.2.0-SNAPSHOT from last night and also it loads almost instantly, sorry @btzq . Can you see any strangities in the console log of the browser?

btzq commented 2 months ago

@DaanHoogland does this help?

Note, ive turned off my adblocker just in case. But results still the same.

Screenshot 2024-09-18 at 9 54 59 PM Screenshot 2024-09-18 at 9 54 08 PM
weizhouapache commented 2 months ago

probably a simple fix

diff --git a/ui/src/components/header/ProjectMenu.vue b/ui/src/components/header/Proj
+ectMenu.vue
index e2f365344d9..c55db5ff925 100644
--- a/ui/src/components/header/ProjectMenu.vue
+++ b/ui/src/components/header/ProjectMenu.vue
@@ -81,7 +81,7 @@ export default {
       const projects = []
       const getNextPage = () => {
         this.loading = true
-        api('listProjects', { listAll: true, page: page, pageSize: 500, showIcon: tr
+ue }).then(json => {
+        api('listProjects', { listAll: true, page: page, pageSize: 500, showIcon: tr
+ue, details: 'min' }).then(json => {
           if (json?.listprojectsresponse?.project) {
             projects.push(...json.listprojectsresponse.project)
           }
weizhouapache commented 2 months ago

I will try to reproduce the issue and verify the fix assigned to myself

weizhouapache commented 2 months ago

@btzq can you run the following commands on mgmt server if you have downloaded cmk ?

time cmk list projects listall=true filter=id,name >/dev/null time cmk list projects listall=true filter=id,name details=min >/dev/null

btzq commented 2 months ago

@weizhouapache here you go

WhatsApp Image 2024-09-19 at 11 30 52 PM

First command take around 36sec Second command take 0.4sec+

weizhouapache commented 2 months ago

@weizhouapache here you go

WhatsApp Image 2024-09-19 at 11 30 52 PM

First command take around 36sec Second command take 0.4sec+

@btzq if so, I think #9711 is what you need

btzq commented 2 months ago

Awesome, thanks @weizhouapache !

DaanHoogland commented 1 month ago

fixed in #9711