# Improve MySQL start time

**URL:** <https://forums.percona.com/t/improve-mysql-start-time/3299>\
**Category:** Percona Server for MySQL 5.6\
**Created:** [February 26, 2014, 10:03am UTC](https://forums.percona.com/t/improve-mysql-start-time/3299 "2014-02-26T10:03:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaigupta](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@jaigupta](https://forums.percona.com/u/jaigupta)\
**Post date:** [February 26, 2014, 10:03am UTC](https://forums.percona.com/t/improve-mysql-start-time/3299/1 "2014-02-26T10:03:37Z")

</div>

A simple MySQL restart is taking too much time. No, it is not doing recovery.

We have tried over 10 restarts one after other.

MySQL stop takes short time but start takes very long time.

We noticed that it is spending too much time reading ibd files.

```auto
watch -n 1 'ls -l /proc/26980/fd | grep .ibd'

```

Above command shows status of MySQL reading .ibd files.  
We noted that for first few minutes, MySQL was very fast but then it started becoming slow and slower.  
We have few thousand small databases with total .ibd files about 800000.

It takes 2.5 hours to start MySQL and it is not recovery.

Is there any way we could speed this up?

PS : We never noticed this with 5.5. This problem is after we upgraded 5.6.

---

<div class="post-metadata">

**Author:** ![jaigupta](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@jaigupta](https://forums.percona.com/u/jaigupta)\
**Post date:** [March 1, 2014, 11:36pm UTC](https://forums.percona.com/t/improve-mysql-start-time/3299/2 "2014-03-01T23:36:06Z")

</div>

Anyone with any suggestion or comment?

---

<div class="post-metadata">

**Author:** ![jaigupta](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@jaigupta](https://forums.percona.com/u/jaigupta)\
**Post date:** [March 5, 2014, 3:10am UTC](https://forums.percona.com/t/improve-mysql-start-time/3299/3 "2014-03-05T03:10:30Z")

</div>

In our multiple tests.

In first minutes speed of mysql is about 2 databases per second but after about an hours speed gradually drops to 1 database per 10 seconds.

We tried playing with table\_open\_cache, table\_definition\_cache, tmp\_table\_size but it does not seems to affect speed.

Anyone have any idea about what variable(s) to look to maintain mysql speed of scanning through all database tables while it starts?

---

<div class="post-metadata">

**Author:** ![jagatveer](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@jagatveer](https://forums.percona.com/u/jagatveer)\
**Post date:** [March 12, 2014, 5:08am UTC](https://forums.percona.com/t/improve-mysql-start-time/3299/4 "2014-03-12T05:08:32Z")

</div>

I have faced this issue on Amazon long ago, as it used to start MySQL after going through each and every database on the server. What platform are you using and how many databases (and how large) you have got on your server?

---

<div class="post-metadata">

**Author:** ![Chase](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@Chase](https://forums.percona.com/u/Chase)\
**Post date:** [December 11, 2018, 1:55am UTC](https://forums.percona.com/t/improve-mysql-start-time/3299/5 "2018-12-11T01:55:52Z")

</div>

Old thread, but if the engine is InnoDB, I recommend looking into increasing innodb\_read\_io\_threads, innodb\_write\_io\_threads, and innodb\_io\_capacity.
