<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PlanetMysql.ru - информация о СУБД MySQL &#187; ACID</title>
	<atom:link href="http://planetmysql.ru/category/acid/feed/" rel="self" type="application/rss+xml" />
	<link>http://planetmysql.ru</link>
	<description>Блог о самой популярной СУБД MySQL</description>
	<lastBuildDate>Fri, 10 Feb 2012 22:53:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Dispelling some unintentional MySQL FUD</title>
		<link>http://datacharmer.blogspot.com/2010/11/dispelling-some-unintentional-mysql-fud.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dispelling-some-unintentional-mysql-fud</link>
		<comments>http://datacharmer.blogspot.com/2010/11/dispelling-some-unintentional-mysql-fud.html#comments</comments>
		<pubDate>Sun, 28 Nov 2010 14:24:00 +0000</pubDate>
		<dc:creator>Giuseppe Maxia</dc:creator>
				<category><![CDATA[ACID]]></category>
		<category><![CDATA[autocommit]]></category>
		<category><![CDATA[FUD]]></category>
		<category><![CDATA[InnoDB]]></category>
		<category><![CDATA[Licensing]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[myth]]></category>
		<category><![CDATA[transactions]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[   There are three types of FUD: the first and more genuine is (#1) the intentional spreading of falsehood, mostly to gain some marketing advantage over a competing product. While I despise this practice, I understand it. Then there is (#2) FUD spread by ignorance, when the originators are so blindly enraged by their hatred  for a product that they don't care about getting the facts straight. And finally, there is a third kind, not less dangerous, which is (#3) the spreading of FUD with good intentions, when the authors believe that they have the facts straight and they want to help.I have recently come across two examples of unintentional FUD. For different reasons, my comments to these public cases did not get through, and then I have to say something about that here in my blog.MySQL is not ACID complaintThis surprising piece of news came in the blog of a company that calls itself the remote DBA experts. The claim is this: if I insert a record in a table and then issue a ROLLBACK command, the record is not rolled back.Anyone who has a minimal knowledge of MySQL knows about InnoDB tables (luckily for the poster, InnoDB is default in MySQL 5.5.6, which he was testing) and autocommit.Reading through the example, one sees that the poster did not know about this piece of information. In MySQL, autocommit is ON by default. So if you want to rollback a record, you need to deactivate it. This is not optimal, and it can be debated, but if you read the docs, you don't claim something that is simply the result of your lack of knowledge. MySQL has shortcomings, but being unable to rollback a record is not one of them. Hence, this is FUD type #2.Why I am writing all this here and not as a comment in that blog? Because I did post a comment, on November 23rd, but as of today, it has not been approved yet. The same is true for comments posted by other more knowledgeable people.MySQL licenses. When it's free and when you need to pay for one.This article is well intentioned. MySQL Licenses: The Do's and Don'ts of Open Source, or What's All the Fuss About? is a well thought piece, with practical examples, to help users decide what to do with MySQL licensing, i.e. when they need to pay and when they don't. Unfortunately, the article contains some unintentional confusion, and therefore leaves the readers with more wrong ideas than they had before.I left a long comment on that blog, but for some unfathomable reason it was reduced to a tiny piece, and thus the need for explaining the matter here again.The poster says this:I make commercial software, which needs to have MySQL installed. My customers can use my commercial software, for which they do need to buy a license, in combination with the MySQL database engine, for which they don't need to pay. Because the MySQL engine is not embedded in my commercial software and I don't redistribute MySQL together with my software, I don't need a commercial license for MySQL and neither do my customers.I am afraid that this wishful information is not correct. The GPL FAQ states it clearly:If a library is released under the GPL (not the LGPL), does that mean that any program which uses it has to be under the GPL or a GPL-compatible license?Yes, because the program as it is actually run includes the library.Another quote:However... as long as I have no desire to sell the embedded MySQL source code commercially, I can let the GPL license apply. Also this is not true. The GPL does not regulate commercial transactions. It only deals with distribution of software. If I want to distribute a public domain but GPL-incompatible software linked to a GPL application or library, I am violating the GPL, even if I don't charge anything.Another source of disinformation is "If you decide to pay for a MySQL license, you don't actually pay for the software."This is also incorrect. Oracle sells two kind of things with MySQL. One thing is a subscription to services (MySQL Enterprise). If you buy this, you are not getting a license (unless you ask for it explicitly) but an agreement about services for a given periods.The other thing that Oracle sells is licenses. They can do it because they own the source code, and they can decide to release it either as GPL (which is what you download from the MySQL site) or with a commercial license. If you ask for a license, you will most definitely get one. You can also get a license together with a subscription, if you are so inclined, but that doesn't mean that you aren't buying a license.The important thing to understand to put the matter in perspective, is that the above information about licensing was still true before 2008, when MySQL was owned by MySQL AB, and it is still true today. Oracle, despite all the preemptive accusations of being ill intentioned, has not changed the rules of the game.]]></description>
			<content:encoded><![CDATA[<table border="0"><tr><td> <a href="http://dev.mysql.com"><img src="http://lh6.ggpht.com/_gVfZHGgf5LA/TPJWVJwXx9I/AAAAAAAAA_M/JD2BwIvzAf0/Sakila_chopping_FUD_2.png" width="400" alt="Sakila dispelling FUD" title="Knowledge is power - FUD is darkness" border="0" /></a> </td><td> There are three types of FUD: the first and more genuine is (#1) the intentional <a href="http://en.wikipedia.org/wiki/Fear,_uncertainty_and_doubt">spreading of falsehood</a>, mostly to gain some marketing advantage over a competing product. While I despise this practice, I understand it. <br />Then there is (#2) FUD spread by ignorance, when the originators are so blindly enraged by their hatred  for a product that they don't care about getting the facts straight. <br />And finally, there is a third kind, not less dangerous, which is (#3) the spreading of FUD with good intentions, when the authors believe that they have the facts straight and they want to help.</td></tr></table>I have recently come across two examples of unintentional FUD. For different reasons, my comments to these public cases did not get through, and then I have to say something about that here in my blog.<br /><br /><h3>MySQL is not ACID complaint</h3><a href="http://www.remotedbaexperts.com/Blog/2010/11/mysql-is-not-acid-compliant/">This surprising piece of news</a> came in the blog of a company that calls itself <i>the remote DBA experts</i>. <br />The claim is this: if I insert a record in a table and then issue a ROLLBACK command, the record is not rolled back.<br />Anyone who has a minimal knowledge of MySQL knows about InnoDB tables (luckily for the poster, InnoDB is default in MySQL 5.5.6, which he was testing) and autocommit.<br />Reading through the example, one sees that the poster did not know about this piece of information. In MySQL, <code>autocommit</code> is ON by default. So if you want to rollback a record, you need to deactivate it. This is not optimal, and it can be debated, but if you read the docs, you don't claim something that is simply the result of your lack of knowledge. MySQL has shortcomings, but being unable to rollback a record is not one of them. Hence, this is FUD type #2.<br />Why I am writing all this here and not as a comment in that blog? Because I did post a comment, on November 23rd, but as of today, it has not been approved yet. The same is true for comments posted by other more knowledgeable people.<br /><br /><h3>MySQL licenses. When it's free and when you need to pay for one.</h3>This article is well intentioned. <a href="http://blog.schonewille.tk/mysql-licenses-the-dos-and-donts-of-open-sour">MySQL Licenses: The Do's and Don'ts of Open Source, or What's All the Fuss About?</a> is a well thought piece, with practical examples, to help users decide what to do with MySQL licensing, i.e. when they need to pay and when they don't. Unfortunately, the article contains some unintentional confusion, and therefore leaves the readers with more wrong ideas than they had before.<br />I left a long comment on that blog, but for some unfathomable reason it was reduced to a tiny piece, and thus the need for explaining the matter here again.<br />The poster says this:<br /><blockquote><i>I make commercial software, which needs to have MySQL installed. My customers can use my commercial software, for which they do need to buy a license, in combination with the MySQL database engine, for which they don't need to pay. Because the MySQL engine is not embedded in my commercial software and I don't redistribute MySQL together with my software, I don't need a commercial license for MySQL and neither do my customers.<br /></i></blockquote>I am afraid that this wishful information is not correct. The <a href="http://www.gnu.org/licenses/gpl-faq.html#IfLibraryIsGPL">GPL FAQ</a> states it clearly:<br /><blockquote><i>If a library is released under the GPL (not the LGPL), does that mean that any program which uses it has to be under the GPL or a GPL-compatible license?<br />Yes, because the program as it is actually run includes the library.</i></blockquote><br />Another quote:<br /><blockquote><i>However... as long as I have no desire to sell the embedded MySQL source code commercially, I can let the GPL license apply. </i></blockquote>Also this is not true. The GPL does not regulate commercial transactions. It only deals with distribution of software. If I want to distribute a public domain but GPL-incompatible software linked to a GPL application or library, I am violating the GPL, even if I don't charge anything.<br /><br />Another source of disinformation is <i>"If you decide to pay for a MySQL license, you don't actually pay for the software."</i><br />This is also incorrect. Oracle sells two kind of things with MySQL. One thing is a subscription to services (MySQL Enterprise). If you buy this, you are not getting a license (unless you ask for it explicitly) but an agreement about services for a given periods.<br />The other thing that Oracle sells is licenses. They can do it because they own the source code, and they can decide to release it either as GPL (which is what you download from <a href="http://dev.mysql.com/downloads">the MySQL site</a>) or with a commercial license. If you ask for a license, you will most definitely get one. You can also get a license together with a subscription, if you are so inclined, but that doesn't mean that you aren't buying a license.<br />The important thing to understand to put the matter in perspective, is that the above information about licensing was still true before 2008, when MySQL was owned by <i>MySQL AB</i>, and it is still true today. Oracle, despite all the preemptive accusations of being ill intentioned, has not changed the rules of the game.<div><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/16959946-5616781279714941807?l=datacharmer.blogspot.com" alt="" /></div><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=26599&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=26599&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/11/28/dispelling-some-unintentional-mysql-fud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why do I recommend switching over from MyISAM to Innodb!</title>
		<link>http://www.ovaistariq.net/460/why-do-i-recommend-switching-over-from-myisam-to-innodb/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=why-do-i-recommend-switching-over-from-myisam-to-innodb</link>
		<comments>http://www.ovaistariq.net/460/why-do-i-recommend-switching-over-from-myisam-to-innodb/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 11:47:33 +0000</pubDate>
		<dc:creator>Ovais Tariq</dc:creator>
				<category><![CDATA[ACID]]></category>
		<category><![CDATA[acid-compliant]]></category>
		<category><![CDATA[adaptive hash indexing]]></category>
		<category><![CDATA[background flushes]]></category>
		<category><![CDATA[Backups]]></category>
		<category><![CDATA[buffer pool]]></category>
		<category><![CDATA[change buffer]]></category>
		<category><![CDATA[Clustered indexes]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[crash recovery]]></category>
		<category><![CDATA[data consistency]]></category>
		<category><![CDATA[database resources]]></category>
		<category><![CDATA[foreign keys]]></category>
		<category><![CDATA[hot backup]]></category>
		<category><![CDATA[InnoDB]]></category>
		<category><![CDATA[innodb resources]]></category>
		<category><![CDATA[innodb vs myisam]]></category>
		<category><![CDATA[locking]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ovaistariq.net/?p=460</guid>
		<description><![CDATA[Although MyISAM has been the default storage engine for MySQL but its soon going to change with the release of MySQL server 5.5. Not only that, more and more people are shifting over to the Innodb storage engine and the reasons for that is the tremendous benefits, not only in terms of performance, concurrency, ACID-transactions, foreign key constraints, but also because of the way it helps out the DBA with hot-backups support, automatic crash recovery and avoiding data inconsistencies which can prove to be a pain with MyISAM. In this article I try to hammer out the reasons why you should move on to using Innodb instead of MyISAM.]]></description>
			<content:encoded><![CDATA[Although MyISAM has been the default storage engine for MySQL but its soon going to change with the release of MySQL server 5.5. Not only that, more and more people are shifting over to the Innodb storage engine and the reasons for that is the tremendous benefits, not only in terms of performance, concurrency, ACID-transactions, foreign key constraints, but also because of the way it helps out the DBA with hot-backups support, automatic crash recovery and avoiding data inconsistencies which can prove to be a pain with MyISAM. In this article I try to hammer out the reasons why you should move on to using Innodb instead of MyISAM.<br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=26476&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=26476&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/11/16/why-do-i-recommend-switching-over-from-myisam-to-innodb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy MySQL: transaction isolation and ACID, the simple explanation</title>
		<link>http://feedproxy.google.com/~r/Themattreid/~3/sKTUjonjjKQ/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=easy-mysql-transaction-isolation-and-acid-the-simple-explanation</link>
		<comments>http://feedproxy.google.com/~r/Themattreid/~3/sKTUjonjjKQ/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 18:45:50 +0000</pubDate>
		<dc:creator>Matt Reid</dc:creator>
				<category><![CDATA[ACID]]></category>
		<category><![CDATA[InnoDB]]></category>
		<category><![CDATA[isolation level]]></category>
		<category><![CDATA[mvcc]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql server]]></category>
		<category><![CDATA[rdbms]]></category>

		<guid isPermaLink="false">http://themattreid.com/wordpress/?p=366</guid>
		<description><![CDATA[Clients often ask what the differences are between the various InnoDB isolation levels, or what ACID means. Here are some simple explanations for those that have not yet read the manual and committed it to memory.
READ UNCOMMITTED
Every select operates without locks so you don&#8217;t get consistency and might have dirt reads, which are potentially earlier versions of data. So, no ACID support here.
READ COMMITTED
Has consistent reads without locks. Each consistent read, even within the same transaction, sets and reads its own fresh snapshot.
REPEATABLE READ
The InnoDB default isolation level for ACID compliance. All reads within the same transaction will be consistent between each other &#8211; ie, the C in ACID. All writes will be durable, etc etc.
SERIALIZABLE
Same as REPEATABLE READ but MySQL converts regular select statements with preface of LOCK IN SHARED MODE when autocommit is enabled. If it&#8217;s disabled then each select is started in a separate transaction which will always make sure that reads are consistent. It also, uh, allows for XA distributed transactions support. You have to be using SERIALIZABLE to correctly use XA transactions.
===========================================================================
ATOMICITY
All transactions fail or no transactions fail. Basically that if a transaction fails because of a hardware issue, connection issue, etc &#8211; that  partial changes won&#8217;t commit. It&#8217;s 100% or 0% operation.
CONSISTENCY
Data being read by a select is all at the same state. So when you use a transaction you&#8217;re getting the most current and consistent data available. This is related to MVCC (multi version concurrency control)
ISOLATION
Nothing that&#8217;s being read is actively being changed by another transaction.  Your connection or transaction&#8217;s read is not going to be changed by another transaction while you&#8217;re dealing with that data.
DURABILITY
Changes to the database persist &#8211; basically that means that if a transaction is committed and the DB fails or server crashes your changes will be there &#8211; which is why innodb uses transaction log files (where data is kept before being written to disk. The engine will read the logs on next startup and commit any remaining transactions in the logs that did not make to disk based tables.)
]]></description>
			<content:encoded><![CDATA[<p>Clients often ask what the differences are between the various InnoDB isolation levels, or what ACID means. Here are some simple explanations for those that have not yet read the manual and committed it to memory.</p>
<p><strong>READ UNCOMMITTED</strong><br />
Every select operates without locks so you don&#8217;t get consistency and might have dirt reads, which are potentially earlier versions of data. So, no ACID support here.</p>
<p><strong>READ COMMITTED</strong><br />
Has consistent reads without locks. Each consistent read, even within the same transaction, sets and reads its own fresh snapshot.</p>
<p><strong>REPEATABLE READ</strong><br />
The InnoDB default isolation level for ACID compliance. All reads within the same transaction will be consistent between each other &#8211; ie, the C in ACID. All writes will be durable, etc etc.</p>
<p><strong>SERIALIZABLE</strong><br />
Same as REPEATABLE READ but MySQL converts regular select statements with preface of LOCK IN SHARED MODE when autocommit is enabled. If it&#8217;s disabled then each select is started in a separate transaction which will always make sure that reads are consistent. It also, uh, allows for XA distributed transactions support. You have to be using SERIALIZABLE to correctly use XA transactions.</p>
<p>===========================================================================</p>
<p><strong>ATOMICITY</strong><br />
All transactions fail or no transactions fail. Basically that if a transaction fails because of a hardware issue, connection issue, etc &#8211; that  partial changes won&#8217;t commit. It&#8217;s 100% or 0% operation.</p>
<p><strong>CONSISTENCY</strong><br />
Data being read by a select is all at the same state. So when you use a transaction you&#8217;re getting the most current and consistent data available. This is related to MVCC (multi version concurrency control)</p>
<p><strong>ISOLATION</strong><br />
Nothing that&#8217;s being read is actively being changed by another transaction.  Your connection or transaction&#8217;s read is not going to be changed by another transaction while you&#8217;re dealing with that data.</p>
<p><strong>DURABILITY</strong><br />
Changes to the database persist &#8211; basically that means that if a transaction is committed and the DB fails or server crashes your changes will be there &#8211; which is why innodb uses transaction log files (where data is kept before being written to disk. The engine will read the logs on next startup and commit any remaining transactions in the logs that did not make to disk based tables.)</p>
<img src="http://feeds.feedburner.com/~r/Themattreid/~4/sKTUjonjjKQ" height="1" width="1" /><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25816&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25816&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/09/09/easy-mysql-transaction-isolation-and-acid-the-simple-explanation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Benchmarking MySQL ACID performance with SysBench</title>
		<link>http://feedproxy.google.com/~r/Themattreid/~3/m7-NK79I2BE/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=benchmarking-mysql-acid-performance-with-sysbench</link>
		<comments>http://feedproxy.google.com/~r/Themattreid/~3/m7-NK79I2BE/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 23:40:50 +0000</pubDate>
		<dc:creator>Matt Reid</dc:creator>
				<category><![CDATA[ACID]]></category>
		<category><![CDATA[commit]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql server]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[relational]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[sysbench]]></category>
		<category><![CDATA[transactions]]></category>
		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://themattreid.com/wordpress/?p=315</guid>
		<description><![CDATA[A couple of question I get a lot from MySQL customers is &#8220;how will this hardware upgrade improve my transactions per second (TPS)&#8221; and &#8220;what level of TPS will MySQL perform on this hardware if I&#8217;m running ACID settings?&#8221; Running sysbench against MySQL with different values for per-thread and global memory buffer sizes, ACID settings, and other settings gives me concrete values to bring to the customer to show the impact that more RAM, faster CPUs, faster disks, or cnf changes have on the server. Here are some examples for a common question: &#8220;If I&#8217;m using full ACID settings vs non-ACID settings what performance am I going to get from this server?&#8221;
Let&#8217;s find out by running sysbench with the following settings (most are self explanatory &#8211; if not the man page can explain them):

sysbench &#8211;test=oltp &#8211;db-driver=mysql &#8211;oltp-table-size=1000000 &#8211;mysql-engine-trx=yes &#8211;oltp-test-mode=complex &#8211;oltp-read-only=off &#8211;oltp-dist-type=special &#8211;max-requests=0 &#8211;num-threads=8 &#8211;max-time=120 &#8211;init-rng=on run

MySQL Settings:
In the first test MySQL is set to the following ACID related settings. This will give us results for TPS performance without full ACID compliance &#8211; very common settings on a server that is handling blogs, ad serving, general business websites, and other roles where full ACID is not required and performance is valued over the benefits of full ACID. These are important settings when we look at the difference in performance when we change to full ACID in the second test.

innodb_flush_log_at_trx_commit = 0
sync_binlog=0
transaction-isolation=REPEATABLE-READ

System configuration and InnoDB buffer pool size:

XEON E5345 Series 2.33ghz 8-core, 16GB RAM, Local SATA 7.2K disks
innodb_buffer_pool_size = 10G

Full result set from sysbench:
Summary OLTP test statistics:

queries performed:
transactions:                        172426 (1436.83 per sec.)
read/write requests:                 3276664 (27304.51 per sec.)
other operations:                    344882 (2873.91 per sec.)

Take away results:
We can simplify the results by looking at the following TPS results for this non-ACID test:

transactions:                        172426 (1436.83 per sec.)

Let&#8217;s go ahead and run the test again with different ACID settings. This will give us the TPS results for full ACID compliance:


innodb_flush_log_at_trx_commit = 1
sync_binlog=1
transaction-isolation=REPEATABLE-READ

We get the following results for TPS:

 transactions:                      3197   (26.58 per sec.)
 read/write requests:                 60743  (505.04 per sec.)
 other operations:                    6394   (53.16 per sec.)

Final Results:
So as you can see the difference between full ACID settings and not (on the same server with only those values on the cnf being changed) results in a huge difference in performance on this standard database server. We can now hand this data to the customer and they will know what impact the settings will have on their application&#8217;s performance and what to expect when running full ACID vs non-ACID.
More info on using sysbench here: http://sysbench.sourceforge.net
]]></description>
			<content:encoded><![CDATA[<p>A couple of question I get a lot from MySQL customers is &#8220;how will this hardware upgrade improve my transactions per second (TPS)&#8221; and &#8220;what level of TPS will MySQL perform on this hardware if I&#8217;m running ACID settings?&#8221; Running sysbench against MySQL with different values for per-thread and global memory buffer sizes, ACID settings, and other settings gives me concrete values to bring to the customer to show the impact that more RAM, faster CPUs, faster disks, or cnf changes have on the server. Here are some examples for a common question: &#8220;If I&#8217;m using full ACID settings vs non-ACID settings what performance am I going to get from this server?&#8221;</p>
<p>Let&#8217;s find out by running sysbench with the following settings (most are self explanatory &#8211; if not the man page can explain them):</p>
<ul>
<li><em>sysbench &#8211;test=oltp &#8211;db-driver=mysql &#8211;oltp-table-size=1000000 &#8211;mysql-engine-trx=yes &#8211;oltp-test-mode=complex &#8211;oltp-read-only=off &#8211;oltp-dist-type=special &#8211;max-requests=0 &#8211;num-threads=8 &#8211;max-time=120 &#8211;init-rng=on run</em></li>
</ul>
<p><strong>MySQL Settings:</strong></p>
<p>In the first test MySQL is set to the following ACID related settings. This will give us results for TPS performance <strong>without</strong> full ACID compliance &#8211; very common settings on a server that is handling blogs, ad serving, general business websites, and other roles where full ACID is not required and performance is valued over the benefits of full ACID. These are important settings when we look at the difference in performance when we change to full ACID in the second test.</p>
<ul>
<li>innodb_flush_log_at_trx_commit = 0</li>
<li>sync_binlog=0</li>
<li>transaction-isolation=REPEATABLE-READ</li>
</ul>
<p><strong>System configuration and InnoDB buffer pool size:</strong></p>
<ul>
<li>XEON E5345 Series 2.33ghz 8-core, 16GB RAM, Local SATA 7.2K disks</li>
<li>innodb_buffer_pool_size = 10G</li>
</ul>
<p><strong>Full result set from sysbench:</strong></p>
<p>Summary OLTP test statistics:</p>
<ul>
<li>queries performed:</li>
<li>transactions:                        172426 (1436.83 per sec.)</li>
<li>read/write requests:                 3276664 (27304.51 per sec.)</li>
<li>other operations:                    344882 (2873.91 per sec.)</li>
</ul>
<p><em><span><strong>Take away results:</strong></span></em></p>
<p><em><span>We can simplify the results by looking at the following TPS results for this non-ACID test:</span></em></p>
<ul><strong></p>
<li><span>transactions</span>:                        172426 (1436.83 per sec.)</li>
<p></strong></ul>
<p>Let&#8217;s go ahead and run the test again with different ACID settings. This will give us the TPS results for full ACID compliance:</p>
<p>
<ul>
<li>innodb_flush_log_at_trx_commit = 1</li>
<li>sync_binlog=1</li>
<li>transaction-isolation=REPEATABLE-READ</li>
</ul>
<p>We get the following results for TPS:</p>
<ul>
<li> transactions:                     <strong> 3197   (26.58 per sec.)</strong></li>
<li> read/write requests:                 60743  (505.04 per sec.)</li>
<li> other operations:                    6394   (53.16 per sec.)</li>
</ul>
<p><strong>Final Results:</strong></p>
<p>So as you can see the difference between full ACID settings and not (on the same server with only those values on the cnf being changed) results in a huge difference in performance on this standard database server. We can now hand this data to the customer and they will know what impact the settings will have on their application&#8217;s performance and what to expect when running full ACID vs non-ACID.</p>
<p>More info on using sysbench here: http://sysbench.sourceforge.net</p>
<img src="http://feeds.feedburner.com/~r/Themattreid/~4/m7-NK79I2BE" height="1" width="1" /><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25063&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25063&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/06/21/benchmarking-mysql-acid-performance-with-sysbench/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>High Insertion Rates into a TokuDB Table with Durable Transactions</title>
		<link>http://tokutek.com/2010/01/high-insertion-rates-into-a-tokudb-table-with-durable-transactions/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=high-insertion-rates-into-a-tokudb-table-with-durable-transactions</link>
		<comments>http://tokutek.com/2010/01/high-insertion-rates-into-a-tokudb-table-with-durable-transactions/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 22:33:54 +0000</pubDate>
		<dc:creator>Tokuview Blog</dc:creator>
				<category><![CDATA[ACID]]></category>
		<category><![CDATA[iibench]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[TokuDB]]></category>
		<category><![CDATA[TokuView]]></category>

		<guid isPermaLink="false">http://tokutek.com/?p=963</guid>
		<description><![CDATA[
We recently made transactions in TokuDB 3.0 durable.  We write table changes into a log file so that in the event of a crash, the table changes up to the last checkpoint can be replayed.  Durability requires the log file to be fsync&#8217;ed when a transaction is committed.  Unfortunately, fsync&#8217;s are not free, and may cost 10&#8217;s of milliseconds of time.  This may seriously affect the insertion rate into a TokuDB table. How can one achieve high insertion rates in TokuDB with durable transactions?


Decrease the fsync cost


The fsync of the TokuDB log file writes all of the dirty log file data that is cached in memory by the operating system to the underlying storage system. The fsync time can be modeled with a simple linear equation: fsync time = N/R + K, where N is the amount of dirty data that needs to by written to disk,  R is the disk write rate, and K is a constant time defined by the storage system. We want to to minimize the fsync time. Note that this model is conceptual and has not been verified by experiment, but it is good enough to identify some opportunities for decreasing the fsync cost.


One can increase the bandwidth of the log device (R). Suppose that large rows are being inserted into the database. A very large amount of log file data may be cached in memory by the operating system before the fsync. A storage system, perhaps a striped RAID, with a high write bandwidth will be able to store this log data quickly.


One can decrease the amount of data (N) that must be written to the log. There are several techniques that may be used here by TokuDB, including logging table rather than dictionary changes, and compressing the log files. These techniques will be shipped in a future TokuDB release.


One can decrease the constant fsync cost (K). A battery backed up RAID may speed up fsync&#8217;s since it writes data to non-volatile memory that is faster than the disks in the RAID.


One can put the TokuDB logs on their own storage system by using the tokudb_log_dir MySQL system variable. This will increase the overall system write bandwidth, and perhaps eliminate contention between the TokuDB log and the TokuDB fractal tree.


Amortize the fsync cost with large transactions


When the fsync time is a significant fraction of the time to execute a transaction, the insertion rate can be increased by using larger transactions.


Does this actually work? We ran iibench with tokudb_commit_sync ON and 1000 rows per transaction and measured over 10K rows/second insertion rate at 250M rows on a Sun Fire X4150. For 10,000 rows per transaction, we measured 15K rows/sec insertion rate.


Relax durability


Several MySQL storage engines provide mechanisms that relax durability by decoupling the fsync from the transaction commit. TokuDB provides the tokudb_commit_sync MySQL session variable, which works as follows.


If tokudb_commit_sync=ON, then the TokuDB log file is fsync&#8217;ed when the transaction commits. When used in this way, all transactions are durable. This is the default setting.


If tokudb_commit_sync=OFF, then the TokuDB log file is not fsync&#8217;ed when the transaction commits. When used in this way, the TokuDB tables recover to a transactionally consistent state that may not  include the transactions committed after the last TokuDB checkpoint. It all depends on when the TokuDB log was last fsync&#8217;ed.


The TokuDB log consists of a sequence of log files, each of which is about 100MiB in size. TokuDB will fsync a log file whenever it fills one up and needs to create the next one. The TokuDB log will also be fsync&#8217;ed by a commit of a transaction in another MySQL client connection that has its tokudb_commit_sync session variable set ON.


How does a TokuDB checkpoint work? TokuDB checkpoints open dictionaries every 60 seconds by taking a snapshot of the current state of the dictionaries, writing all of the dirty dictionary data to disk, fsyncing the dictionary files, and finally fsyncing the TokuDB log.


We ran the iibench with tokudb_commit_sync OFF and measured over 17K rows/second insertion rate at 250M rows on a Sun Fire X4150.


The tokudb_commit_sync session variable may  be used to implement application defined durability. For example, the application can set the tokudb_commit_sync session variable ON once per second rather than for every transaction. The effect will be one second worth of transaction vulnerability.


Summary


Durable transactions in TokuDB increase the write bandwidth to the storage system. This may make the storage system a performance bottleneck. If this is the case, one may consider using a storage system for the TokuDB logs with higher write bandwidth. One may also entertain relaxing the durability requirements of the application and control the fsync&#8217;s by the application.]]></description>
			<content:encoded><![CDATA[<p>
We recently made transactions in TokuDB 3.0 durable.  We write table changes into a log file so that in the event of a crash, the table changes up to the last checkpoint can be replayed.  Durability requires the log file to be fsync&#8217;ed when a transaction is committed.  Unfortunately, fsync&#8217;s are not free, and may cost 10&#8217;s of milliseconds of time.  This may seriously affect the insertion rate into a TokuDB table. How can one achieve high insertion rates in TokuDB with durable transactions?
</p>
<h3>
Decrease the fsync cost<br />
</h3>
<p>
The fsync of the TokuDB log file writes all of the dirty log file data that is cached in memory by the operating system to the underlying storage system. The fsync time can be modeled with a simple linear equation: fsync time = <i>N</i>/<i>R</i> + <i>K</i>, where <i>N</i> is the amount of dirty data that needs to by written to disk,  <i>R</i> is the disk write rate, and <i>K</i> is a constant time defined by the storage system. We want to to minimize the fsync time. Note that this model is conceptual and has not been verified by experiment, but it is good enough to identify some opportunities for decreasing the fsync cost.
</p>
<p>
One can increase the bandwidth of the log device (<i>R</i>). Suppose that large rows are being inserted into the database. A very large amount of log file data may be cached in memory by the operating system before the fsync. A storage system, perhaps a striped RAID, with a high write bandwidth will be able to store this log data quickly.
</p>
<p>
One can decrease the amount of data (<i>N</i>) that must be written to the log. There are several techniques that may be used here by TokuDB, including logging table rather than dictionary changes, and compressing the log files. These techniques will be shipped in a future TokuDB release.
</p>
<p>
One can decrease the constant fsync cost (<i>K</i>). A battery backed up RAID may speed up fsync&#8217;s since it writes data to non-volatile memory that is faster than the disks in the RAID.
</p>
<p>
One can put the TokuDB logs on their own storage system by using the <tt>tokudb_log_dir</tt> MySQL system variable. This will increase the overall system write bandwidth, and perhaps eliminate contention between the TokuDB log and the TokuDB fractal tree.
</p>
<h3>
Amortize the fsync cost with large transactions<br />
</h3>
<p>
When the fsync time is a significant fraction of the time to execute a transaction, the insertion rate can be increased by using larger transactions.
</p>
<p>
Does this actually work? We ran iibench with <tt>tokudb_commit_sync</tt> ON and 1000 rows per transaction and measured over 10K rows/second insertion rate at 250M rows on a Sun Fire X4150. For 10,000 rows per transaction, we measured 15K rows/sec insertion rate.
</p>
<h3>
Relax durability<br />
</h3>
<p>
Several MySQL storage engines provide mechanisms that relax durability by decoupling the fsync from the transaction commit. TokuDB provides the <tt>tokudb_commit_sync</tt> MySQL session variable, which works as follows.
</p>
<p>
If <tt>tokudb_commit_sync=ON</tt>, then the TokuDB log file is fsync&#8217;ed when the transaction commits. When used in this way, all transactions are durable. This is the default setting.
</p>
<p>
If <tt>tokudb_commit_sync=OFF</tt>, then the TokuDB log file is not fsync&#8217;ed when the transaction commits. When used in this way, the TokuDB tables recover to a transactionally consistent state that may not  include the transactions committed after the last TokuDB checkpoint. It all depends on when the TokuDB log was last fsync&#8217;ed.
</p>
<p>
The TokuDB log consists of a sequence of log files, each of which is about 100MiB in size. TokuDB will fsync a log file whenever it fills one up and needs to create the next one. The TokuDB log will also be fsync&#8217;ed by a commit of a transaction in another MySQL client connection that has its <tt>tokudb_commit_sync</tt> session variable set ON.
</p>
<p>
How does a TokuDB checkpoint work? TokuDB checkpoints open dictionaries every 60 seconds by taking a snapshot of the current state of the dictionaries, writing all of the dirty dictionary data to disk, fsyncing the dictionary files, and finally fsyncing the TokuDB log.
</p>
<p>
We ran the iibench with <tt>tokudb_commit_sync</tt> OFF and measured over 17K rows/second insertion rate at 250M rows on a Sun Fire X4150.
</p>
<p>
The <tt>tokudb_commit_sync</tt> session variable may  be used to implement application defined durability. For example, the application can set the <tt>tokudb_commit_sync</tt> session variable ON once per second rather than for every transaction. The effect will be one second worth of transaction vulnerability.
</p>
<h3>
Summary<br />
</h3>
<p>
Durable transactions in TokuDB increase the write bandwidth to the storage system. This may make the storage system a performance bottleneck. If this is the case, one may consider using a storage system for the TokuDB logs with higher write bandwidth. One may also entertain relaxing the durability requirements of the application and control the fsync&#8217;s by the application.</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=22900&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=22900&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/01/06/high-insertion-rates-into-a-tokudb-table-with-durable-transactions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

