<?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>Racker Hacker &#187; innodb</title>
	<atom:link href="http://rackerhacker.com/tag/innodb/feed/" rel="self" type="application/rss+xml" />
	<link>http://rackerhacker.com</link>
	<description>Words of wisdom from a server administrator</description>
	<lastBuildDate>Wed, 16 May 2012 12:55:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>MySQL: The total number of locks exceeds the lock table size</title>
		<link>http://rackerhacker.com/2010/02/16/mysql-the-total-number-of-locks-exceeds-the-lock-table-size-2/</link>
		<comments>http://rackerhacker.com/2010/02/16/mysql-the-total-number-of-locks-exceeds-the-lock-table-size-2/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 18:00:29 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1173</guid>
		<description><![CDATA[If you're running an operation on a large number of rows within a table that uses the InnoDB storage engine, you might see this error: ERROR 1206 (HY000): The total number of locks exceeds the lock table size MySQL is trying to tell you that it doesn't have enough room to store all of the [...]<p><a href="http://rackerhacker.com/2010/02/16/mysql-the-total-number-of-locks-exceeds-the-lock-table-size-2/">MySQL: The total number of locks exceeds the lock table size</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>If you're running an operation on a large number of rows within a table that uses the InnoDB storage engine, you might see this error:</p>
<p><code>ERROR 1206 (HY000): The total number of locks exceeds the lock table size</code></p>
<p>MySQL is trying to tell you that it doesn't have enough room to store all of the row locks that it would need to execute your query.  The only way to fix it for sure is to adjust <code>innodb_buffer_pool_size</code> and restart MySQL.  By default, this is set to only 8MB, which is too small for anyone who is using InnoDB to do anything.</p>
<p><strong>If you need a temporary workaround,</strong> reduce the amount of rows you're manipulating in one query.  For example, if you need to delete a million rows from a table, try to delete the records in chunks of 50,000 or 100,000 rows.  If you're inserting many rows, try to insert portions of the data at a single time.</p>
<p>Further reading:</p>
<ul>
<li><a href="http://bugs.mysql.com/bug.php?id=15667">MySQL Bug #15667 - The total number of locks exceeds the lock table size</a></li>
<li><a href="http://mrothouse.wordpress.com/2006/10/20/mysql-error-1206/">MySQL Error 1206 &raquo; Mike R's Blog</a></li>
</ul>
<p><a href="http://rackerhacker.com/2010/02/16/mysql-the-total-number-of-locks-exceeds-the-lock-table-size-2/">MySQL: The total number of locks exceeds the lock table size</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/02/16/mysql-the-total-number-of-locks-exceeds-the-lock-table-size-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>MySQL: The total number of locks exceeds the lock table size</title>
		<link>http://rackerhacker.com/2010/01/29/mysql-the-total-number-of-locks-exceeds-the-lock-table-size/</link>
		<comments>http://rackerhacker.com/2010/01/29/mysql-the-total-number-of-locks-exceeds-the-lock-table-size/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 13:12:21 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1156</guid>
		<description><![CDATA[This problem has cropped up for me a few times, but I've always forgotten to make a post about it. If you're working with a large InnoDB table and you're updating, inserting, or deleting a large volume of rows, you may stumble upon this error: ERROR 1206 (HY000): The total number of locks exceeds the [...]<p><a href="http://rackerhacker.com/2010/01/29/mysql-the-total-number-of-locks-exceeds-the-lock-table-size/">MySQL: The total number of locks exceeds the lock table size</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>This problem has cropped up for me a few times, but I've always forgotten to make a post about it.  If you're working with a large InnoDB table and you're updating, inserting, or deleting a large volume of rows, you may stumble upon this error:</p>
<p><code>ERROR 1206 (HY000): The total number of locks exceeds the lock table size</code></p>
<p>InnoDB stores its lock tables in the main buffer pool.  This means that the number of locks you can have at the same time is limited by the <code>innodb_buffer_pool_size</code> variable that was set when MySQL was started.  By default, MySQL leaves this at 8MB, which is pretty useless if you're doing anything with InnoDB on your server.</p>
<p>Luckily, the fix for this issue is very easy: adjust <code>innodb_buffer_pool_size</code> to a more reasonable value.  However, that fix does require a restart of the MySQL daemon.  There's simply no way to adjust this variable on the fly (with the current stable MySQL versions as of this post's writing).</p>
<p>Before you adjust the variable, make sure that your server can handle the additional memory usage.  The <code>innodb_buffer_pool_size</code> variable is a server wide variable, not a per-thread variable, so it's shared between all of the connections to the MySQL server (like the query cache).  If you set it to something like 1GB, MySQL won't use all of that up front.  As MySQL finds more things to put in the buffer, the memory usage will gradually increase until it reaches 1GB.  At that point, the oldest and least used data begins to get pruned when new data needs to be present.</p>
<p><strong>So, you need a workaround without a MySQL restart?</strong></p>
<p>If you're in a pinch, and you need a workaround, break up your statements into chunks.  If you need to delete a million rows, try deleting 5-10% of those rows per transaction.  This may allow you to sneak under the lock table size limitations and clear out some data without restarting MySQL.</p>
<p>To learn more about InnoDB's parameters, visit the <a href="http://dev.mysql.com/doc/refman/5.0/en/innodb-parameters.html">MySQL documentation</a>.</p>
<p><a href="http://rackerhacker.com/2010/01/29/mysql-the-total-number-of-locks-exceeds-the-lock-table-size/">MySQL: The total number of locks exceeds the lock table size</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/01/29/mysql-the-total-number-of-locks-exceeds-the-lock-table-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

