Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

warmwhisky's avatar

Laravel with sail and docker all of sudden slow today

As of today my migrations and mysql are terribly slow. 41 seconds to create spatie permissions table create_permission_tables (41,778.28ms)

I am not aware of changing anything apart from upgrading Docker Desktop last week. I also found an update for Docker today, but the speed is still super slow.

Does anyone have any ideas?

Windows 10
Docker 4.10.0
WSL2 Ubuntu 20.04
Laravel 9.17

I have tried adding a .myconf file to docker as below but made no difference

[mysqld]
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
datadir         = /var/lib/mysql
secure-file-priv= NULL
innodb_io_capacity = 2000
innodb_read_io_threads = 64
innodb_thread_concurrency = 64
innodb_write_io_threads = 64

Migration timings

Migrating: 2014_10_12_000000_create_users_table
Migrated:  2014_10_12_000000_create_users_table (3,118.15ms)
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated:  2014_10_12_100000_create_password_resets_table (3,130.65ms)
Migrating: 2014_10_12_200000_add_two_factor_columns_to_users_table
Migrated:  2014_10_12_200000_add_two_factor_columns_to_users_table (1,202.02ms)
Migrating: 2019_08_19_000000_create_failed_jobs_table
Migrated:  2019_08_19_000000_create_failed_jobs_table (2,673.01ms)
Migrating: 2019_12_14_000001_create_personal_access_tokens_table
Migrated:  2019_12_14_000001_create_personal_access_tokens_table (4,276.81ms)
Migrating: 2020_05_21_100000_create_teams_table
Migrated:  2020_05_21_100000_create_teams_table (2,492.17ms)
Migrating: 2020_05_21_200000_create_team_user_table
Migrated:  2020_05_21_200000_create_team_user_table (2,791.71ms)
Migrating: 2020_05_21_300000_create_team_invitations_table
Migrated:  2020_05_21_300000_create_team_invitations_table (8,106.24ms)
Migrating: 2022_06_08_064246_create_sessions_table
Migrated:  2022_06_08_064246_create_sessions_table (6,700.21ms)
Migrating: 2022_06_08_074624_create_permission_tables
Migrated:  2022_06_08_074624_create_permission_tables (41,778.28ms)
0 likes
6 replies
warmwhisky's avatar

I have found this is also happening when I use Xampp. I have a few project using php 7.4 and importing a group of small databases kept timing out. It used to take around 1 minute to import them all, but now I t got up to an hour and a half!

This must be something to do with windows as it is slow on both Xampp and WSL2 with Docker.

Any have any idea how Windows would be slowing connections to Mysql?

warmwhisky's avatar

I'm not sure if I was changing settings and not waiting long enough for the containers to update or if I had corrupt volumes or containers, but after leaving it for the weekend and then deleting the MySQL volume it was back to normal.

previous to this I uninstalled WSL and Docker Desktop and then reinstalled but it was still the same. I really cannot be sure what fixed the issue?

mohit89.verma@gmail.com's avatar

Please disable WSL2 on your windows and docker. you may need to reinstall the docker once you disabled the WSL from windows. Please make sure Hyper V must be enabled.

warmwhisky's avatar

@mohit89.verma@gmail.com I moved over to working only in Ubuntu and have not had the same issues. Incidentaly this is a known issue and has been open for a few years on github https://github.com/microsoft/WSL/issues/4901 Because of the lack of real solutions and the many little solutions that either do not work or work only for a while I moved to Ubuntu

Please or to participate in this conversation.