Skip to content

Performance/Resource Utilization issue on Windows #644

@Ryntak94

Description

@Ryntak94

Windows version / build number: Microsoft Windows [Version 10.0.22631.5189]

WSL os and version (default from running wsl --instal Ubuntu):
Distributor ID: Ubuntu
Description: Ubuntu 24.04.2 LTS
Release: 24.04
Codename: noble

.wslconfig
[wsl2]
memory=27GB
processors=16

Steps required to reproduce:

Ensure that you have npm installed (I'm using node 18, anything more recent will likely work. nvm can solve this problem for you if you have issues.
Ensure you have make installed sudo apt install make
Ensure you have docker desktop installed and configured to work with wsl.

Clone this repo into the wsl file system. (I cd ~ before cloning it)

make start
This will
Install node_modules
Start the docker container
Create the dump.sql file (2GB, but you can make this smaller if you'd like. It just needs to be large enough that it takes time to import into mariadb)
Start importing the dump file into mariadb by copying it into the container first, then importing it from the file in the container.

Once you see the line docker compose exec -T mariadb mariadb --user root --max-allowed-packet=1G --quick -e "source /tmp/dump.sql" open a separate instance of wsl and navigate to the repo and run make stats. This will show you the the cpu usage by the container.

You can also use make exec_mariadb_container and once inside top -b -n 1 to see the cpu and mem usage.

Comparing between a mac and wsl:
Mac:
make stats shows 40% minimum cpu usage by the container in this example. It also shows 2.62@ MEM%
make exec_mariadb_container >> top -b -n 1 shows 30-50% %CPU and 1.3 %MEM by the mysql user/mariadbd command
make exec_mariadb_container >> top -b -n 1 shows 12.5 %CPU and .1 %MEM by the root user/mariadb command

WSL:
make stats shows 6% minimum cpu usage, 20% max cpu usage by the container in this example. It also shows .6% MEM %
make exec_mariadb_container >> top -b -n 1 shows 13-20 %CPU and .6 %MEM by the mysql user/mariadbd command
make exec_mariadb_container >> top -b -n 1 shows 0 %CPU and 0 %MEM by the root user/mariadb command

In my work scenario, it's a much more complicated dump file and the Mac will hit 250% MEM% from make stats, here, where as the WSL is the exact same.

Please advise if there is anything I can do to make the WSL performance better.
I have tried the same thing on Windows without WSL and a brand new Docker Desktop installation without WSL and also experienced the same issue

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions