Yesterday I installed Ubuntu 17.10 on my desktop and today I wanted to migrate a MySQL datababase (php artisan migrate:fresh with laravel), but my database was very slow. The migrations only, took around 30 seconds.

On my macbook these migrations take only a few seconds (under 5 seconds).

I tried google and got a lot of settings I could change in my.cnf. For example the following settings:

innodb_io_capacity = 2000
innodb_read_io_threads = 64
innodb_thread_concurrency = 0
innodb_write_io_threads = 64

This didn't made it any faster. I also found the option for slow query logging, but the output file is empty after the migrations.

Does someone have any other solutions?

Ps. I removed the settings from my.cnf because it didn't made it faster and I wasn't sure whether to keep the settings or not.

I have mysql-server-5.7.

  • Didnt you ask EXACTLY this a couple of hours ago – RiggsFolly Dec 20 '17 at 16:55
  • Do a select * from table limit 10000; then see how much time it'll take. Also consider indexes. – Bhuvanesh Dec 20 '17 at 18:04

long_query_time = 1 (or possibly a lower value); this will help get something useful in the slowlog.

With rare exceptions, "You can't tune you way out of a performance problem."

How much RAM?

Find some slow SQL so we can discuss it. Please provide the corresponding SHOW CREATE TABLE so we know what the table(s) look like.

# Set innodb_buffer_pool_size to 70-80 % of RAM
innodb_buffer_pool_size = 4G
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 1G 

  • 3
    Why these numbers? Do we know how much RAM the server has? – ypercubeᵀᴹ Dec 21 '17 at 10:42
  • The comments are good; the values in the actual assignments are examples. – Rick James Dec 25 '17 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.