-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ui: speed up compute instance listing #7911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The default listVirtualMachinesMetrics APIs assumings details=all which isn't really used in the list view. By changing this to a subset of details, we can see gains upto 10x in listing speed in the UI. When moving to the resource/detail view of the UI, don't pass state or details so `all` the details of the instance are returned. Signed-off-by: Rohit Yadav <[email protected]>
|
@rohityadavcloud a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
| var params = {} | ||
| var params = { details: 'servoff,tmpl,nics' } | ||
| if (store.getters.metrics) { | ||
| params = { state: 'running' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed running as otherwise metrics doesn't return all VMs in the list. One can select VM state explicitly in the compute/instance page if they want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just realised I can remove state from the params
| export const DARK_MODE = 'DARK_MODE' | ||
| export const VUE_VERSION = 'VUE_VERSION' | ||
| export const CUSTOM_COLUMNS = 'CUSTOM_COLUMNS' | ||
| export const RELOAD_ALL_PROJECTS = 'RELOAD_ALL_PROJECTS' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a warning
| var params = { details: 'servoff,tmpl,nics' } | ||
| if (store.getters.metrics) { | ||
| params = { state: 'running' } | ||
| params = { details: 'servoff,tmpl,nics,stats' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VM stats in the API response can cause 5-10x delay compared to normal list API response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is tmpl needed in the details? or stats?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my concern is opposite to @DaanHoogland :-D
is 'servoff,tmpl,nics' or servoff,tmpl,nics,stats enough for UI ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, these are enough just for list view (table view); the stats are only needed when the metrics button is clicked. For the resource view, we delete the params.details, so by default details=all is used when listing a single VM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weizhouapache @DaanHoogland
I tested this again both as root admin and normal user account; for VMs and templates with and without resource icons; these are enough details to render the list view (table); when the user clicks any VM/instance, then we call the API remove the details and all details are listed/used in the resource view. While not ideal, this speeds up the listing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, thanks @rohityadavcloud
I will test it
|
UI build: ✔️ |
| if (['listVirtualMachinesMetrics'].includes(this.apiName) && this.dataView) { | ||
| delete params.state | ||
| delete params.details | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rohityadavcloud
can you explain why state and details are removed ?
all others look good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are added by the router config, I'll ping you on that code; so we must remove if the keys exists for dataView (or resource view, when only one item is being listed such as the VM)
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good. I can't judge the performance gain in qa, but am relying on the author in this case.
| var params = { details: 'servoff,tmpl,nics' } | ||
| if (store.getters.metrics) { | ||
| params = { state: 'running' } | ||
| params = { details: 'servoff,tmpl,nics,stats' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is tmpl needed in the details? or stats?
| resourceType: 'UserVm', | ||
| params: () => { | ||
| var params = {} | ||
| var params = { details: 'servoff,tmpl,nics' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weizhouapache because of these params, details and state...
| } | ||
| if (['listVirtualMachinesMetrics'].includes(this.apiName) && this.dataView) { | ||
| delete params.details |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we remove the details as it may not be all, and set for the list view (tabular view)
Codecov Report
@@ Coverage Diff @@
## 4.18 #7911 +/- ##
============================================
- Coverage 13.06% 13.06% -0.01%
- Complexity 9088 9091 +3
============================================
Files 2720 2720
Lines 257391 257415 +24
Branches 40130 40136 +6
============================================
Hits 33621 33621
- Misses 219548 219569 +21
- Partials 4222 4225 +3 see 6 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
@rohityadavcloud a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
weizhouapache
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
the VM search give exact VM and is not changing to the first VM in list after we exclude state,IP of VM at filter in field |


The default listVirtualMachinesMetrics APIs assumings details=all which isn't really used in the list view. By changing this to a subset of details, we can see gains upto 10x in listing speed in the UI. When moving to the resource/detail view of the UI, don't pass state or details so
allthe details of the instance are returned.Possibly fixes #7910
In the screenshot below, we can see passing details=min, and other combinations show significant reduction in network time (from 300-400ms to 20-40ms)
Types of changes