Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Mainframes are often leased, and with leasing charges based on how many CPU cores are used (regardless of how many are physically present).


One cool feature of the z16 was that all cores can be activated during startup, and then all cores that aren't licensed (paid for) shut down and the performance drops to the agreed limit. I do that with my KVM machines on the server under my desk - all are configured with more cores than needed and, when boot finishes, most cores are removed from process scheduling leaving just the amount the VM is supposed to use during normal operation. The result is a significantly faster start up and significantly lower power consumption (and resource contention).


Blog post worthy.

I wasn’t even aware you could tell the kernel not to schedule on some cores.

Yet, its as easy as:

    echo 0 > /sys/devices/system/cpu/cpu{num}/online


I recently learned you can do this on Windows also. The kernel won't schedule anything to run on a the reserved cores but you can pin high priority processes to them. Good for a polling loop.


Your comment isn't clear as to why. If you assign two vCPUs to a KVM VM, why would limiting the VM's kernel to only scheduling on one vCPU increase the speed? The vCPUs are typically all on one physical CPU anyway, unlike a mainframe. You can also set affinity/processor pinning in KVM if you have more than one physical CPU/core, with the VM being none the wiser.


This caps host CPU usage from the VM after startup processes finish. During startup a process in a VM can use all of the host cores the VM was configured with. Then, when startup is finished and we start doing what the VM is supposed to do, its core usage is limited, preventing noisy neighbors problem. Individual VM performance will be lower, but the host will be more responsive.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: