Sail command in WSL2 slow, have others the same problem?
Just playing around with Laravel in docker and use WSL2 on windows 10. It works great and I am really happy with the setup and workflow.
But commands in wsl2 is slow, for example the command "sail artisan tinker" takes about 6-7 seconds to bring the tinker command line up, the same for making migrations, controllers etc.
Is that what we have to live with or is it just my setup? Anyone has a solution?
It might be dependent on your computer specs. I have a gaming pc and every command I load takes a few miliseconds. You can check in your task manager if its using too much of your RAM/cpu.
fraserk is right I believe, my spec is good and windows is suppose to allocate ram “on demand”, still wsl wont use more then 2gb when i run Sail command.
Yes, that a real issue. It's not an issue with the specs of your pc. I'm having the same issue. I'm experimenting with running run docker from WSL2. I've seen big improvement so far.
I will give that a go thanks, other threads in regards to WSL2 mention the mount point to windows as a slowing factor but that wasn’t an issue in WSL1 and I tried in that as well with the same result.
I tried it and it is the mount in the windows file system, for now the workaround is to install my projects in the WSL2 Ubuntu file system and as I work with VS code it wont matter so much. It is back to normal speed, phuuu!