tart icon indicating copy to clipboard operation
tart copied to clipboard

Introduce reserve / pinning / affinity of CPUs

Open zimmski opened this issue 2 years ago • 4 comments

We currently try to fix problems around benchmarking for our MacOS VMs that use Tart. One problem i noticed is that there is no option to "reserve" CPU cores for the VMs nor to pin them on the same cores. Would be nice if such options could be introduced or at least documented on why they do not exist.

zimmski avatar Sep 22 '23 09:09 zimmski

Unfortunately, this is behaviour of the underlying Virtualizaiton.Framework which I tried to document in #584

We also see disturbances when running on a M2 chip with 4 performance and 4 efficiency cores. When running a single VM with 4 cores it will use all the performance cores and when there are 2 VMs they will split 2 and 2 cores which lowers the performance.

What kind of testing are you performing? Do you run two VMs at a time?

fkorotkov avatar Sep 22 '23 11:09 fkorotkov

@fkorotkov @zimmski Is there a way to limit CPUs or default to use them all? Also, is there a way to set the RAM size for memory?

theonetheycallneo avatar Oct 03 '23 18:10 theonetheycallneo

There is no way to default to use all the available resource. You can configure CPUs and memory via tart set though. Please refer to tart set --help.

fkorotkov avatar Oct 03 '23 18:10 fkorotkov

@fkorotkov https://eclecticlight.co/2023/10/23/how-does-macos-manage-virtual-cores-on-apple-silicon/

ruimarinho avatar Oct 23 '23 22:10 ruimarinho

I don't think we'll ever be able to pin CPUs so will close the issues as not planned. Virtualization.Framework does a good job of balancing the load between performance and efficiency cores.

fkorotkov avatar Jun 17 '24 14:06 fkorotkov