In windows 10 machine I have installed Rancher Desktop which requires WSL2.
Whenever I started the Rancher Desktop, the vmmem
process started high CPU utilization and going till 100%. I am seeing article to limit the memory using wslconfig file (c:\Users\damie\.wslconfig
), but only the memory.
Is there way to limit CPU as well?
[wsl2]
memory=4GB
Thanks.
You can use "processors" which can be used to set how many cores the WSL2 has available. For example:
[wsl2]
memory=16000MB #Limits VM memory in WSL 2 to 900MB
processors=8 #Makes the WSL 2 VM use eight virtual processors
Here's the documentation from Microsoft.