Script to monitor and limit CPU usage on resource intensive VMs

harmonyp

Member
Nov 26, 2020
196
4
23
47
I am seeking out a monitoring script that would limit VMs that are using too much CPU usage over a long period of time.

Example

VM1 (4vCPU 2 core/2thread) uses 80%+ CPU (of total cores allocated) for 24 hours, gets 50% reduction down from 4 vCPU to 2 via CPU Limit

After 6 hours of the CPU no longer being at 80%+ usage the full 4vCPU are restored

Are there any monitoring tools like this? I am unable to find anything on Github
 
I don't have an answer that is backed by thorough knowledge but as far as I know, cpu cores can only be changed upon reboot.

You could try to change the niceness of the respective qm/kvm process on host level, though, so that other processes get a higher priority.
 
I don't have an answer that is backed by thorough knowledge but as far as I know, cpu cores can only be changed upon reboot.

You could try to change the niceness of the respective qm/kvm process on host level, though, so that other processes get a higher priority.
"CPU limit" in this screenshot can be changed without a reboot
c75732371af6fcd092c4a93a5506b48a.png
 
Hm, with my hardware the cpu core count is printed in orange until it becomes black with the next reboot ...