docker on wsl2 very slow

后端 未结 6 1910
离开以前
离开以前 2021-01-01 17:13

After having read about the performance improvements when running Docker on wsl2, I have been waiting for the official release of Windows 10 that supports wsl2. I updated Wi

6条回答
  •  借酒劲吻你
    2021-01-01 18:02

    This comes from the "vmmem" which consumes as much resource as it can. To solve the problem just go to your user file for me in

    C:\Users\userName

    In this directory create a file named ".wslconfig" in which you will configure how many resources can consume WSL2:

    [wsl2] 
    memory=900MB    #Limits VM memory in WSL 2 to 900MB 
    processors=1    #Makes the WSL 2 VM use one virtual processors
    

    Now close your docker and wait for "vmmem" to close in the task manager.

    then You can restart docker and normally "vmmem" will not exceed the limit you have set (here 900MB) If don't work restart your computer.

    I hope it helped you.

提交回复
热议问题