-
Notifications
You must be signed in to change notification settings - Fork 605
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
Bug 1946232: VM List can consume very high CPU #9696
Bug 1946232: VM List can consume very high CPU #9696
Conversation
@glekner: This pull request references Bugzilla bug 1946232, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
setVmStatus(vmStatusBundle); | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [loaded]); |
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.
so the vm status is never updated beside the first one when you load resources ? That does not seem correct
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.
you are right, I guess there is no going around listening to all resources? @rawagner
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.
there isnt. You can optimize it by using useMemo
and not the state/effect combo.
You can also try comparing previous state result with current one with deep compare
model = VirtualMachineModel; | ||
options = vmMenuActions.map((action) => | ||
action(model, vm, { | ||
vmStatusBundle, | ||
vmStatusBundle: {}, |
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.
@rawagner do you think creating a lazy kebab menu is a viable solution here?
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.
hm...maybe let the user know you're waiting for status ? Something like disabled item loading status
etc ?
const [dvs, setDvs] = React.useState<V1alpha1DataVolume[]>([]); | ||
const [pvcs, setPvcs] = React.useState<PersistentVolumeClaimKind[]>([]); | ||
|
||
const watchedResources = React.useMemo( |
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.
you do not have to use useMemo anymore, watchK8s hook is comparing the input args using deep compare
f4568f7
to
c169145
Compare
84cad98
to
3e77449
Compare
|
d981e47
to
48a21fa
Compare
/lgtm |
/retest |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
6 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
19 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
@glekner: All pull requests linked via external trackers have merged: Bugzilla bug 1946232 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This PR adds a lazy status that loads the vm status bundle after the table renders.
This change improves the performance of queries when having 500+ VMs
While the status loads almost instantly, this is how the loading component looks for the status column
Screen.Recording.2021-08-02.at.14.58.01.mov
Here are performance recordings on x4 CPU slowdown, from the moment a query was typed until the new results were rendered:
Before 9033ms
After 4601ms