HostOnNet Blog

MySQL take too much time to start

On one of the Free phpBB hosting server, MySQL take about 18 minutes to start.

That is if i restart MySQL for any reason (including server reboot), it take too much time to just start the MySQL server.

The server have a second hard disk, so i moved the MySQL data folder to that HD to improve IO performance, but still it take lot of time to start.

# uptime;date;service mysqld start;date;uptime;service httpd start
05:46:15 up 5 days, 1:24, 2 users, load average: 0.24, 1.07, 1.23
Wed May 7 05:46:15 CDT 2008
Starting MySQL: [ OK ]
Wed May 7 06:04:21 CDT 2008
06:04:21 up 5 days, 1:42, 1 user, load average: 1.77, 1.65, 1.50
Starting httpd: [ OK ]
#

When i start MySQL, it do chown -R mysql:mysql /backup/mysql

# ps aux|grep mysql
root 23549 0.0 0.0 4448 1168 pts/0 S+ 05:24 0:00 /bin/sh /sbin/service mysqld start
root 23556 0.0 0.0 4628 1272 pts/0 S+ 05:24 0:00 /bin/bash /etc/init.d/mysqld start
root 23613 1.5 7.5 157668 154580 pts/0 D+ 05:24 0:01 chown -R mysql:mysql /backup/mysql
root 23780 0.0 0.0 3896 664 pts/1 S+ 05:26 0:00 grep mysql
#

That take lot of time to finish, slowing the MySQL start.

I made a quick fix by disabling chown command in /etc/init.d/mysqld, but this is not the proper way and can create permission problems.

MySQL database size is 11 GB, this include 7.5G database of phpBB hosted forums, 2.2 GB for hosted WordPress Mu and few other small databases.

Anyway to speed up the MySQL start other than commenting out the chown line ?


Posted in MySQL