Welcome!

Thanks for visiting. If you found this information interesting or useful (or you think I'm dead wrong about something) I'd like to invite you to leave a comment on this post. You can also subscribe to my RSS feed or sign up for email updates on the right-hand side of the page.

If you Digg what you StumbleUpon, find my writing del.icio.us, or are one of the Technorati, you know what to do:

Speed up laptop boot & resume times with large MySQL databases

I’m in the interesting position of using my laptop for both programming work and day-to-day web surfing. I’m the lead developer for SAGrader, a web-based computationally intelligent essay grading system. We use MySQL for the database, and naturally I run a copy on my laptop to develop with. Unfortunately, MySQL and laptop power-saving goes together like chocolate and arsenic.

Ubuntu solves this problem by stopping MySQL on each suspend and starting it again on each resume. This is horribly bad for performance if you have a large database like I do because each MySQL server startup incurs almost a minute of mysqlcheck running. Rather than disable this, here’s a way to make it hurt less.

  1. Install the schedutils package: sudo aptitude install schedutils
  2. Modify /etc/mysql/debian-start and change the “MYCHECK=…” link to this: MYCHECK="ionice -c3 /usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
  3. Restart the MySQL server to observe the effects

As long as you are using the CFQ kernel scheduler (default on Ubuntu Edgy and newer kernels), ionice can set mysqlcheck’s IO priority to idle, which means your laptop is much more responsive much sooner. Well worth the effort in my opinion!

Related posts:

  1. Crank up your Ubuntu I just read this article on xsol.se and tried out...
  2. Dell Inspiron 9400 with Ubuntu Dapper Drake A few weeks ago I bought a new Dell Inspiron...
  3. “Easter” in America I really enjoy the web cartoon/commentary/drawing blog/idunno called Indexed. I...

One Response to “Speed up laptop boot & resume times with large MySQL databases


Leave a Reply