Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MySQL (Innodb vs MyISAM)
#1
Recently I was having severe mysql problems with my biggest forum. I would have constant crashes and I tried just about everything.

Eventually I tried to alter tables from myisam to innodb and with a few minor adjustments my 1.8gb database was actually consuming 1/10th of it's previous resources. Where I was nearly about to get a new server now I have room to double or even triple in database size without a problem.

The secret why innodb was so much more efficient was how it handles table locks over mysiam. The method used by myisam to lock tables is to lock the entire table on every read/write. Innodb does row-level locking which means only the effected row is locked.

For tables that are constantly accessed that get locked very often Innodb is incredibly efficient. One important note is that innodb does take more overheard and ram but for large databases the offset could be a huge difference to your server resources.

Here is a blog post I made about my adjustments: Innodb Vs MyISAM
Superman I am here to rescue you.
This is Support Forums not Support PMs.  Do not PM me for support unless it's private and site related.
Reply
#2
I was always creating MyISAM, because I never took some time to read how InnoDB works...
You could say I was afraid of errors I might get into and wouldn't be able to resolve it...!

But if I understand you right, I'm good with using MyISAM on small sites with not that much content saved in the database.
I'll work with InnoDB to see how it works, thanks for sharing!
Reply
#3
You'll most likely benefit from the stability of MYISAM in most situations. Innodb is going to be slower on small sites that aren't as active but as activity grows and tables are waiting in locked states innodb would do better.

I was doing 250 queries per second with 1 out 35 queries being locked. So that's 6-8 query per seconds would lock. You take into account busy periods and long queries then you can see how that's a problem. With innodb I have 1:250 lock. I rarely see my tables with lock problems now. Innodb has been fantastic at solving my problems.
Superman I am here to rescue you.
This is Support Forums not Support PMs.  Do not PM me for support unless it's private and site related.
Reply
#4
I understand, I will write a script that will overload my database with content to see how it affects the site...
Then switch to InnoDB, so I can see what you're talking about in action...

But MySQL Commands are still the same, I just need to convert few table types?
Reply
#5
InnoDB is better, IMHO.

I use InnoDB for my personal website, i converted from MyISAM like you and I noticed a huge change.
Reply
#6
You are precisely correct. Innodb has more fixed resource usage, but less additional usage as the db gets bigger. MyISAM has less fixed load but causes more resource usage, as the DB gets bigger. ;) [I read it somewhere]
Innodb = good for big sites
myisam = good for small sites
[Image: vhc689.jpg]
do noт мaĸe мe мad. ι wιll ĸιll yoυ.
-rep me if you want to get banned! please!
Anonymous rep is for freakin cowards!
Reply
#7
I have never used InnoDB because my database is not large enough to bother switching.
(05-24-2010, 06:15 PM)Omniscient Wrote: We take HF refugees in bulk.
Lol
Reply
#8
Thats very good. It seems to be much more efficient.

On an un-related note, I'm curious about backups for your large sites?
Reply
#9
Curious about what in particular? I do regular backups.
Superman I am here to rescue you.
This is Support Forums not Support PMs.  Do not PM me for support unless it's private and site related.
Reply
#10
(05-24-2010, 06:12 PM)Omniscient Wrote: Curious about what in particular? I do regular backups.

What do you use to restore them?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  vb6.0 + mysql Anurag.91 1 1,792 09-08-2012, 04:19 PM
Last Post: spesificrelax
  Creating and inserting data into a PHP and MySQL Database Peter L 9 4,645 03-24-2012, 10:49 AM
Last Post: Haxalot
  VB.NET MySql , Help please booterphhp 2 1,875 03-19-2012, 11:13 AM
Last Post: RainbowDashFTW
  [TUT] Include mySQL into php. MyNameIs940 48 26,237 01-14-2012, 04:45 PM
Last Post: Strafeness
  MySQL question ImFocuzz 8 3,150 07-17-2011, 06:57 PM
Last Post: Pedo bear

Forum Jump:


Users browsing this thread: 2 Guest(s)