I have this PC configuration, which should have quite normal performance compared to common laptops:
ASUS TUF GAMING A15
AMD Ryzen 7 4800H
16GB RAM on 3200 MHz
SSD
64b Windows 10
First, I setup WSL2 and it was rather slow and I realized that the OpenSuse over WSL was probably swapping, because the processor has a lot of cores, but the 16GB was not enough for it.
So basically I open .wslconfig
and set processors=2
and swap=0
, it greatly improved performance of the WSL, probably stopped swapping.
- Was it a good idea?
So I was using the WSL quite happily, but after some time, I needed to install VMware for testing some functionality and it worked until the first reboot of the virtual machine and after that I realized that I can't use both WSL and VMware on 1 system, because the VMware wanted me to disable some option on Windows that was needed by WSL. (I think it was something with virtualization)
But after using the VMware I used the WSL again and realized that it's way slower. I checked the changes from the git, I rebuilt everything, I reverted to versions as before, but it was still way slower than before. I needed to start using docker container at that time (because of different reason), it was running quite fast at first so I did not pay much attention. But then I realized that some operations run very slowly and I did not know, why. Then I realized it must have been that VMware, so I uninstalled it and the WSL got faster, only the WSL, but the slowness in docker container remained.
When I check a Task Manager, CPU and Disk seem totally fine and Memory seems fine as well. So I guess the docker container is probably not using all available resources? The task runs 30 minutes instead of running 10 seconds which runs on similar PC directly, without docker container, it's huge difference...
Before running task in docker container:
While running task in docker container:
- How to set VSCode to make the docker container use much more resources and run the task almost as fast as without running it in a docker container?
I realized it's maybe related toDisabling Real-time protection only removed its 5% CPU usage, but did not make the container task any faster.Antimalware Service Executable
process, which takes around 5% CPU when running the task and usesMicrosoft Defender Antivirus Service
service. Can it be the problem? If so, how to add exception for the docker container or VSCode which runs it, in the least intrusive way?
I called docker stats
and it's really not using almost any resources at all, see: