I'm using Laravel Sail on a WSL2 instance, on Windows 11 (Home). The project I'm working on is installed in the WSL filesystem, as I always do.
After executing any sail command, there's a delay of ~10 seconds before the command output is shown.
I've noticed that running the same commands directly with docker compose, has a little delay(~1.5sec), but nothing compared to sail.
Docker Compose
$ time docker compose exec laravel.test php artisan
docker-compose exec laravel.test php artisan 0.04s user 0.02s system 1% cpu 3.323 total
Sail
$ time sail artisan
sh $([ -f sail ] && echo sail || echo vendor/bin/sail) artisan 0.27s user 0.29s system 5% cpu 9.623 total
Ok, now that's weird!
time reports that sail is executing the command in 0.27s, but as you can see from the following screen recording, that's not the case at all!
Please, if you know what can be the cause of this, let me know.
- I always used Laravel Sail / Docker without any problem, even if I'm using WSL (some people say it's slow, but I'm not of the same opinion).
- I already checked other answers without any luck.
- I'm not sure if this depends on my machine setup, or it's related to the version of the involved software.
- The project is using
Laravel 9.xandLaravel Sail 1.41 - Before writing this post, I tried to switch my WSL instance from Ubuntu 22.04 to 24.04, but the problem persisted.
Thanks
