Comments on: Innodb Performance Optimization Basics http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ Everything about MySQL Performance Fri, 04 Jul 2008 14:42:17 +0000 http://wordpress.org/?v=2.5.1 By: Mansoor http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-289866 Mansoor Tue, 29 Apr 2008 17:06:38 +0000 http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-289866 Great Article. 1- I have an insert/update intensive application with millions of insert/update operations per day (planned). The web client that reads from the database requires several indexes, however having those indexes slows down the insert/update operations. Is it advisable to set up replication such that the MASTER database does not have any indexes (except those required for updates), and the SLAVE has all the required indexes for the web clients? This should theretically get faster inserts/updates on MASTER, and fast retrievals on the SLAVE. Please advise. 2- How much of a difference does it make to have the MySQL server on a dedicated machine? Is there an article that addresses this issue? Great Article.

1- I have an insert/update intensive application with millions of insert/update operations per day (planned). The web client that reads from the database requires several indexes, however having those indexes slows down the insert/update operations. Is it advisable to set up replication such that the MASTER database does not have any indexes (except those required for updates), and the SLAVE has all the required indexes for the web clients? This should theretically get faster inserts/updates on MASTER, and fast retrievals on the SLAVE. Please advise.

2- How much of a difference does it make to have the MySQL server on a dedicated machine? Is there an article that addresses this issue?

]]>
By: peter http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-287744 peter Fri, 25 Apr 2008 07:25:10 +0000 http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-287744 Lance - MyISAM can be faster than Innodb to insert the data and Innodb can be faster than MyISAM to insert the data - it all depends on what you're looking at. For inserts in single table by single user MyISAM most likely will win because of Transactional overhead in Innodb, however if you have large system and many concurrent inserts or parallel long running queries Innodb is likely to be faster because MyISAM has table level locks. Lance - MyISAM can be faster than Innodb to insert the data and Innodb can be faster than MyISAM to insert the data - it all depends on what you’re looking at. For inserts in single table by single user MyISAM most likely will win because of Transactional overhead in Innodb, however if you have large system and many concurrent inserts or parallel long running queries Innodb is likely to be faster because MyISAM has table level locks.

]]>
By: Lance http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-287457 Lance Thu, 24 Apr 2008 22:10:07 +0000 http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-287457 I can't seem to get the code to show up. It's inserting NULL, $i, $i, microtime() into the table five million times, incrementing each time. I can’t seem to get the code to show up. It’s inserting NULL, $i, $i, microtime() into the table five million times, incrementing each time.

]]>
By: Lance http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-287455 Lance Thu, 24 Apr 2008 22:08:22 +0000 http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-287455 I just noticed there is a significant part of the script missing, here is the script: I wrote less than or equal to because it seems the site stopped writing all text after the less than symbol in my first post. I hope this post makes it. Thanks again. I just noticed there is a significant part of the script missing, here is the script:

I wrote less than or equal to because it seems the site stopped writing all text after the less than symbol in my first post. I hope this post makes it.

Thanks again.

]]>
By: Lance http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-287453 Lance Thu, 24 Apr 2008 22:04:22 +0000 http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-287453 Hello, I have read many places that InnoDB is supposed to be faster for inserts. I created the following simple script that inserts 5,000,000 records into a four column table. I run it once inserting into a MyISAM table, and run it a second time inserting into an InnoDB table. Every time I run the test (even after changing the innodb_buffer_pool_size). The MyISAM table finishes approximately 4 times faster than the InnoDB table. This is significant. Now, the first thing I've noticed is that my machine is SIGNIFICANTLY less powerful than the machines you are discussing, however, I have not read where machine performance dictates the percentage of increase of InnoDB vs MyISAM. (Although I don know it it memory intensive.) I have a machine with ~768M RAM and 250G drive. It is a dedicated machine for a SMALL website. I don't think I'll ever have more that 16 million rows in any given table. (innodb_buffer_pool_size=550M) Here is the script: <?php function microtime_float(){ list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $time_start = microtime_float(); echo "Start Time for InnoDB: " . $time_start . "\n"; $db = mysql_connect("localhost","user","password"); for ($i=1;$i MyISAM results: 1532.69 seconds. (25.54 minutes) InnoDB results: 6815.43 seconds. (1 hour, 53.59 minutes) I also changed the innodb_flush_method=O_DIRECT. I did not see significant gains (if any), but I must have deleted the nohup.out file. Any advise would be greatly appricated. I apologize if this is too much to ask for a given forum. Hello, I have read many places that InnoDB is supposed to be faster for inserts. I created the following simple script that inserts 5,000,000 records into a four column table. I run it once inserting into a MyISAM table, and run it a second time inserting into an InnoDB table. Every time I run the test (even after changing the innodb_buffer_pool_size). The MyISAM table finishes approximately 4 times faster than the InnoDB table. This is significant. Now, the first thing I’ve noticed is that my machine is SIGNIFICANTLY less powerful than the machines you are discussing, however, I have not read where machine performance dictates the percentage of increase of InnoDB vs MyISAM. (Although I don know it it memory intensive.)

I have a machine with ~768M RAM and 250G drive. It is a dedicated machine for a SMALL website. I don’t think I’ll ever have more that 16 million rows in any given table. (innodb_buffer_pool_size=550M)

Here is the script:
<?php
function microtime_float(){
list($usec, $sec) = explode(” “, microtime());
return ((float)$usec + (float)$sec);
}
$time_start = microtime_float();
echo “Start Time for InnoDB: ” . $time_start . “\n”;
$db = mysql_connect(”localhost”,”user”,”password”);
for ($i=1;$i

MyISAM results: 1532.69 seconds. (25.54 minutes)
InnoDB results: 6815.43 seconds. (1 hour, 53.59 minutes)

I also changed the innodb_flush_method=O_DIRECT. I did not see significant gains (if any), but I must have deleted the nohup.out file.

Any advise would be greatly appricated. I apologize if this is too much to ask for a given forum.

]]>
By: peter http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-286077 peter Tue, 22 Apr 2008 23:45:47 +0000 http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-286077 Thanks. Fixed. Thanks. Fixed.

]]>
By: Maneesh http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-285986 Maneesh Tue, 22 Apr 2008 21:24:53 +0000 http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-285986 transaction-isolation=READ-COMITTED please make that COMMITTED with a double M. transaction-isolation=READ-COMITTED

please make that COMMITTED with a double M.

]]>
By: Patrick http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-275657 Patrick Mon, 14 Apr 2008 02:50:42 +0000 http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-275657 [..]Of course if there is a mix between MyISAM and Innodb it is other story.[...] Do you still recommand thoses settings for a 65% INNODB, 35% MyISAM database ? Does MyISAM performance will be affected ? I'll soon be switching for a MySQL dedicated server with 16Go of Ram, this post is really interesting to me. [..]Of course if there is a mix between MyISAM and Innodb it is other story.[...]
Do you still recommand thoses settings for a 65% INNODB, 35% MyISAM database ? Does MyISAM performance will be affected ? I’ll soon be switching for a MySQL dedicated server with 16Go of Ram, this post is really interesting to me.

]]>
By: peter http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-252085 peter Wed, 12 Mar 2008 19:08:27 +0000 http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-252085 If you run 32bit Linux you will be limited to 32bit address space for MySQL which will limit how much memory you can use. Plus it will be slower for kernel to access large memory. If you run 32bit Linux you will be limited to 32bit address space for MySQL which will limit how much memory you can use.

Plus it will be slower for kernel to access large memory.

]]>
By: Thiru http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-251996 Thiru Wed, 12 Mar 2008 13:45:58 +0000 http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/#comment-251996 Oh, thank you for the many excellent posts! :) Oh, thank you for the many excellent posts! :)

]]>