vendredi 17 juin 2016

Laravel 5 database migration refresh on MariaDB causes slow index rebuild

I have a fairly mid size application built on Laravel 5.2 and every time I refresh the database using this command:

php artisan migrate:refresh --seed

I noticed the process can be a little slow, sometime take up to a minute. I am using mariadb with this configuration: http://ift.tt/1QbfIpg

The application itself isn't slow, just during the migrate refresh, it's slow.

I checked the logs and I saw lots of these entries:

2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : Start
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : Start reading clustered index of the table and create temporary files
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : End of reading clustered index of the table and create temporary files
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : Start merge-sorting index `PRIMARY` (1 / 1), estimated cost : 20.0000
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : End of  merge-sorting index `PRIMARY` (1 / 1)
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : Start building index `PRIMARY` (1 / 1), estimated cost : 30.0000
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : End of building index `PRIMARY` (1 / 1)
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : Completed
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : Start
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : Start reading clustered index of the table and create temporary files
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : End of reading clustered index of the table and create temporary files
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : Start merge-sorting index `PRIMARY` (1 / 1), estimated cost : 20.0000
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : merge-sorting has estimated 2 runs
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : merge-sorting current run 1 estimated 2 runs
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : End of  merge-sorting index `PRIMARY` (1 / 1)
2016-06-17 12:29:48 532 [Note] InnoDB: Online DDL : Start building index `PRIMARY` (1 / 1), estimated cost : 30.0000
2016-06-17 12:29:49 532 [Note] InnoDB: Online DDL : End of building index `PRIMARY` (1 / 1)
2016-06-17 12:29:49 532 [Note] InnoDB: Online DDL : Completed
2016-06-17 12:29:49 532 [Note] InnoDB: Online DDL : Start
2016-06-17 12:29:49 532 [Note] InnoDB: Online DDL : Start reading clustered index of the table and create temporary files
2016-06-17 12:29:49 532 [Note] InnoDB: Online DDL : End of reading clustered index of the table and create temporary files
2016-06-17 12:29:49 532 [Note] InnoDB: Online DDL : Start merge-sorting index `PRIMARY` (1 / 1), estimated cost : 20.0000
2016-06-17 12:29:49 532 [Note] InnoDB: Online DDL : End of  merge-sorting index `PRIMARY` (1 / 1)
2016-06-17 12:29:49 532 [Note] InnoDB: Online DDL : Start building index `PRIMARY` (1 / 1), estimated cost : 30.0000
2016-06-17 12:29:49 532 [Note] InnoDB: Online DDL : End of building index `PRIMARY` (1 / 1)
2016-06-17 12:29:49 532 [Note] InnoDB: Online DDL : Completed

Here's the full log: http://ift.tt/267iZtI

So, I want to know what's causing this slow migration refresh? Is it poor application design? or is my mariadb not tuned correctly?

I don't see this problem on Linux hosting environment, only on my local windows dev machine running: WPИ-XM

Any ideas?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire