rohityadavcloud opened a new pull request, #8985:
URL: https://github.com/apache/cloudstack/pull/8985
- Changes behaviour of details param handling for:
- listVirtualMachines API: when the detail param is not provided, it uses
`all` details except `stats`
- listVirtualMachinesMetrics API: when the detail param is not provided,
it uses `all` details including `stats`
- Remove ConfigKey vm.stats.increment.metrics.in.memory which was renamed to
`vm.stats.increment.metrics` in #5984
- Changes default value of VM stats accumulation setting
`vm.stats.increment.metrics` to false until a better solution emerges. Since
#5984, this is true and during the execution of listVM APIs the stats are
clubbed/calculated which can immensely slow down list VM API calls.
- Fix UI that uses listVirtualMachinesMetrics to not call `stats` detail
when in list view without metrics selected.
These changes see 2-4x gains in the listVirtualMachines APIs call and in the
UI. For environment where code changes are not possible, disabling
`vm.stats.increment.metrics` global setting saw 2-4x speed gain in the list API
calls.
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [x] Major
- [ ] Minor
#### Bug Severity
- [ ] BLOCKER
- [x] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
### How Has This Been Tested?
Tested a workaround in a 4.18.2.0 env KVM based, with only 12 VMs:
1. List VM API call without details and with details but global setting
`vm.stats.increment.metrics` disabled:
<img width="1097" alt="Screenshot 2024-04-26 at 11 29 31 AM"
src="https://github.com/apache/cloudstack/assets/95203/67d134d9-71c6-4f9e-a159-18516786eb07">
2. List VM API call without detail and with detail and
`vm.stats.increment.metrics` enabled:
<img width="1067" alt="Screenshot 2024-04-26 at 11 31 15 AM"
src="https://github.com/apache/cloudstack/assets/95203/e8473829-e3c0-424a-ba46-7f863eae6272">
- We see ~3-4x gains by simply disabling the global setting
- We see 15x gains when stats details isn't used but the global setting is
enabled
- We see 4x gains when stats detail isn't used and global setting is disabled
With this PR, I propose to change the earlier behaviour for
listVirtualMachines API to exclude stats when details aren't provided. This can
immensely speed up several integrations, who call listVMs APIs that not
necessarily need `stats` in it.
While, the listVirtualMachinesMetrics API was amended to retain old
behaviour so when details aren't passed it could
return all details including stats as expected. In the release notes likely
we can mention about this, so folks who don't want accumulated stats can
disable it but for new env we don't want to encourage this by default (as we
already have the nice vm history metrics feature/tab).
#### How did you try to break this feature and the system with this change?
<!-- see how your change affects other areas of the code, etc. -->
<!-- Please read the
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
document -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]