Tuesday, 10 February 2009

MySQL Chills

So, want to get a quick chill down your spine? Have a huge database in MySQL where most of the tables are using the InnoDB storage engine? Running on a 32-bit version of Linux on a server with 4GB or so of RAM? Try this neat little trick.

Modify your my.cnf file and set the innodb_buffer_pool_size variable to a value north of 2GB. Sounds like a good idea, right? The more memory you allocate to the InnoDB Buffer Pool, the faster InnoDB table access will be. Cool. Change that setting and save that bad boy. Jump over and do a mysql restart.

MySQL shuts down normally.

MySQL starts to come back up, but seems to take a while. Hmmm…. After a minute or so, it completes startup and says [ok].

Except none of your data is there. At least, no tables that use InnoDB are there.

AAAAAAAAAAHHHHHHHHHHH!!!!!

No warnings, no error message, no tables. And your blood pressure is at about 215/180.

After quickly issuing a mysql stop, editing the my.cnf to restore the original settings, and doing a mysql start, you’ll see the tables back and all is well.

It should take about 20 minutes to calm back down.

It’s not like I’m speaking from experience or anything…

update: Just so this doesn’t hang out there… the problem was I attempted to allocate more than 2GB of RAM to a single item, which causes problems on most 32-bit versions of Linux… Had I been on the 64-bit version of RedHat, I probably would’ve been fine. Since I wasn’t, the InnoDB storage engine didn’t start up, and therefore all tables using InnoDB didn’t show up. No data loss whatsoever; I just found it “interesting” that the startup of MySQL didn’t warn me that InnoDB had choked and died. phew.


2 comments

2 Responses to “MySQL Chills”

  1. Seun Osewa Says:

    Thanks for telling us what not to do. Heh. And pls don’t forget to file an official bug report!

  2. Steve Says:

    No bug report needed, it was a goof on my part. Should’ve realized that allocating more than 2GB would cause a problem, I was just surprised that I didn’t get any kind of warning or error message on startup.

Leave a Reply

navigation:

feed:

other devoll.net sites:

search devoll.net:

archives:

categories:

things I'm watching:

Cars
Blu-ray
Ratatouille
Blu-ray
The Chronicles of Narnia: Prince Caspian
Blu-ray + Digital Copy
Star Wars: Clone Wars
Blu-ray + Digital Copy
The Dark Knight
Blu-ray
Dr. Seuss'
Horton Hears a Who
Blu-ray
Wall-E
Blu-ray
Sleeping Beauty
Blu-ray

things I'm reading:

powered by wordpress 2.8.4
16 queries. 0.238 seconds