<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How much memory can MySQL use in the worst case?</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2009/02/12/how-much-memory-can-mysql-use-in-the-worst-case/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2009/02/12/how-much-memory-can-mysql-use-in-the-worst-case/</link>
	<description>Everything about MySQL Performance</description>
	<lastBuildDate>Sat, 21 Nov 2009 14:15:21 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: yingkuan</title>
		<link>http://www.mysqlperformanceblog.com/2009/02/12/how-much-memory-can-mysql-use-in-the-worst-case/comment-page-1/#comment-486195</link>
		<dc:creator>yingkuan</dc:creator>
		<pubDate>Mon, 23 Feb 2009 00:38:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=625#comment-486195</guid>
		<description>Erm, correction, I meant to say &#039;you should NOT have any innodb related mem  usage&#039;</description>
		<content:encoded><![CDATA[<p>Erm, correction, I meant to say &#8216;you should NOT have any innodb related mem  usage&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yingkuan</title>
		<link>http://www.mysqlperformanceblog.com/2009/02/12/how-much-memory-can-mysql-use-in-the-worst-case/comment-page-1/#comment-486193</link>
		<dc:creator>yingkuan</dc:creator>
		<pubDate>Mon, 23 Feb 2009 00:37:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=625#comment-486193</guid>
		<description>Heiðar,

If you are using MYISAM then you should have any Innodb related memory usage like 
buffer pool, redo buffer, additional mem pool etc. 
you might want to first look into that. use either

show innodb status
show variables like &#039;inno%&#039;;

also what your key buffer size, sort buffer size and query cache setting?
Actually if you look the first half of this article, Baron already provided a good list to look at when innodb not used.</description>
		<content:encoded><![CDATA[<p>Heiðar,</p>
<p>If you are using MYISAM then you should have any Innodb related memory usage like<br />
buffer pool, redo buffer, additional mem pool etc.<br />
you might want to first look into that. use either</p>
<p>show innodb status<br />
show variables like &#8216;inno%&#8217;;</p>
<p>also what your key buffer size, sort buffer size and query cache setting?<br />
Actually if you look the first half of this article, Baron already provided a good list to look at when innodb not used.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baron Schwartz</title>
		<link>http://www.mysqlperformanceblog.com/2009/02/12/how-much-memory-can-mysql-use-in-the-worst-case/comment-page-1/#comment-482342</link>
		<dc:creator>Baron Schwartz</dc:creator>
		<pubDate>Thu, 19 Feb 2009 13:33:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=625#comment-482342</guid>
		<description>That question is better asked on mailing lists, forums, an IRC channel, or addressed by hiring us :)  You&#039;ve admitted that you&#039;ve been hired yourself to provide an answer to the problem...</description>
		<content:encoded><![CDATA[<p>That question is better asked on mailing lists, forums, an IRC channel, or addressed by hiring us <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   You&#8217;ve admitted that you&#8217;ve been hired yourself to provide an answer to the problem&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiðar Eiríksson</title>
		<link>http://www.mysqlperformanceblog.com/2009/02/12/how-much-memory-can-mysql-use-in-the-worst-case/comment-page-1/#comment-482260</link>
		<dc:creator>Heiðar Eiríksson</dc:creator>
		<pubDate>Thu, 19 Feb 2009 11:35:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=625#comment-482260</guid>
		<description>Hello, and thanks for all the great information on this site.

I have a huge problem.
I was recently hired to &quot;fix&quot; a web that Realestate agents use to advertise properties for sale and/or rent.

We are currently using MySQL and MyISAM tables and we keep running out of memory so the server starts to swap and then crashes.

What makes me realy scratch my head is that the database isn&#039;t even that big....the rows in the property table ar only about 15500 at the moment.

In the runtime information i can see that we have about  177.23 k select queries per hour wich accounts for 91.48% of the server load.

There are a bunch of varibales that jump out as not good to be, here are a few:
Innodb_buffer_pool_reads  	12
Handler_read_rnd  	        2,448 k(this increases steady as the server runs)
Handler_read_rnd_next  	        105 M(this increases steady as the server runs)
Created_tmp_disk_tables  	9,208
Select_full_join  	        1,074(the application is using indexes to join the tables so this puzzles me)
Sort_merge_passes  	        2,602 
Opened_tables           	1,500
Table_locks_waited  	        74

hope this is enough information to help you help me.

The server has 6GB memory running on Linux
and a 

Is it the queries that are to blame here or could i optimize the config for the server some....maybe use InnoDB since the database is 3NF and uses alot of selects using joins?

Any tips and help would be immensly helpfull.

Thanks in advance,
Heiðar Eiríksson</description>
		<content:encoded><![CDATA[<p>Hello, and thanks for all the great information on this site.</p>
<p>I have a huge problem.<br />
I was recently hired to &#8220;fix&#8221; a web that Realestate agents use to advertise properties for sale and/or rent.</p>
<p>We are currently using MySQL and MyISAM tables and we keep running out of memory so the server starts to swap and then crashes.</p>
<p>What makes me realy scratch my head is that the database isn&#8217;t even that big&#8230;.the rows in the property table ar only about 15500 at the moment.</p>
<p>In the runtime information i can see that we have about  177.23 k select queries per hour wich accounts for 91.48% of the server load.</p>
<p>There are a bunch of varibales that jump out as not good to be, here are a few:<br />
Innodb_buffer_pool_reads  	12<br />
Handler_read_rnd  	        2,448 k(this increases steady as the server runs)<br />
Handler_read_rnd_next  	        105 M(this increases steady as the server runs)<br />
Created_tmp_disk_tables  	9,208<br />
Select_full_join  	        1,074(the application is using indexes to join the tables so this puzzles me)<br />
Sort_merge_passes  	        2,602<br />
Opened_tables           	1,500<br />
Table_locks_waited  	        74</p>
<p>hope this is enough information to help you help me.</p>
<p>The server has 6GB memory running on Linux<br />
and a </p>
<p>Is it the queries that are to blame here or could i optimize the config for the server some&#8230;.maybe use InnoDB since the database is 3NF and uses alot of selects using joins?</p>
<p>Any tips and help would be immensly helpfull.</p>
<p>Thanks in advance,<br />
Heiðar Eiríksson</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shane Bester</title>
		<link>http://www.mysqlperformanceblog.com/2009/02/12/how-much-memory-can-mysql-use-in-the-worst-case/comment-page-1/#comment-481146</link>
		<dc:creator>Shane Bester</dc:creator>
		<pubDate>Wed, 18 Feb 2009 12:33:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=625#comment-481146</guid>
		<description>Hi!

I reported this strange memory consumption formula as a bug after I got tired of questions about it: 

http://bugs.mysql.com/bug.php?id=35661</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>I reported this strange memory consumption formula as a bug after I got tired of questions about it: </p>
<p><a href="http://bugs.mysql.com/bug.php?id=35661" rel="nofollow">http://bugs.mysql.com/bug.php?id=35661</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baron Schwartz</title>
		<link>http://www.mysqlperformanceblog.com/2009/02/12/how-much-memory-can-mysql-use-in-the-worst-case/comment-page-1/#comment-479308</link>
		<dc:creator>Baron Schwartz</dc:creator>
		<pubDate>Mon, 16 Feb 2009 14:37:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=625#comment-479308</guid>
		<description>I doubt that Monty is the right person to ask to fix InnoDB ;-)  Percona and Oracle are the experts there.  You can also hire us to figure out what&#039;s wrong here (I didn&#039;t say that before, because it seems like stating the obvious).</description>
		<content:encoded><![CDATA[<p>I doubt that Monty is the right person to ask to fix InnoDB <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />   Percona and Oracle are the experts there.  You can also hire us to figure out what&#8217;s wrong here (I didn&#8217;t say that before, because it seems like stating the obvious).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sheeri K. Cabral</title>
		<link>http://www.mysqlperformanceblog.com/2009/02/12/how-much-memory-can-mysql-use-in-the-worst-case/comment-page-1/#comment-479251</link>
		<dc:creator>Sheeri K. Cabral</dc:creator>
		<pubDate>Mon, 16 Feb 2009 12:30:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=625#comment-479251</guid>
		<description>Brice,

Monty recently posted that his company does NRE, or Non-Recurring Engineering.  This is explained on http://askmonty.org/wiki/index.php/Commercial_offerings as &quot;Provide bug fixes for MySQL that is not fixed in the standard MySQL release from Sun.&quot;  

I think it would be a good idea to send him an enquiry.</description>
		<content:encoded><![CDATA[<p>Brice,</p>
<p>Monty recently posted that his company does NRE, or Non-Recurring Engineering.  This is explained on <a href="http://askmonty.org/wiki/index.php/Commercial_offerings" rel="nofollow">http://askmonty.org/wiki/index.php/Commercial_offerings</a> as &#8220;Provide bug fixes for MySQL that is not fixed in the standard MySQL release from Sun.&#8221;  </p>
<p>I think it would be a good idea to send him an enquiry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baron Schwartz</title>
		<link>http://www.mysqlperformanceblog.com/2009/02/12/how-much-memory-can-mysql-use-in-the-worst-case/comment-page-1/#comment-476822</link>
		<dc:creator>Baron Schwartz</dc:creator>
		<pubDate>Sat, 14 Feb 2009 16:28:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=625#comment-476822</guid>
		<description>Brice, it surely seems that something weird is going on with InnoDB.  I&#039;ve personally built systems where temporary InnoDB tables are created and dropped like mad, and not seen this behavior.  You shouldn&#039;t be using that much memory for 300 tables.</description>
		<content:encoded><![CDATA[<p>Brice, it surely seems that something weird is going on with InnoDB.  I&#8217;ve personally built systems where temporary InnoDB tables are created and dropped like mad, and not seen this behavior.  You shouldn&#8217;t be using that much memory for 300 tables.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brice Figureau</title>
		<link>http://www.mysqlperformanceblog.com/2009/02/12/how-much-memory-can-mysql-use-in-the-worst-case/comment-page-1/#comment-475458</link>
		<dc:creator>Brice Figureau</dc:creator>
		<pubDate>Fri, 13 Feb 2009 18:27:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=625#comment-475458</guid>
		<description>@Arjan,
I don&#039;t really know if it&#039;s a memory leak but it didn&#039;t happened when we were running under 4.0. I reported this issue around 5.0.27 to mysql, and they indeed find one memory leak. Unfortunately this didn&#039;t fix my issue.
We&#039;re running with short lived connections, and with a wait timeout of 120s, since that was my first thought (I mean long lived connections from our game servers).

@Baron, 
Here is my mem status:

Total memory allocated 8751883484; in additional pool allocated 20926208
Buffer pool size   458752
...

Which mean per your formula:
mysql&gt; select 8751883484 - (458752*16384) - 20926208;
+----------------------------------------+
&#124; 8751883484 - (458752*16384) - 20926208 &#124;
+----------------------------------------+
&#124;                             1214764508 &#124; 
+----------------------------------------+

That&#039;s 1.2GB for 1.5 week of uptime, ouch.

We have about 300 innodb tables. But about 20 of them are truncated every 5s (not dropped) as they are used to compute online games rankings. Maybe that&#039;s temporary table ending in the dictionnary?

I&#039;m not running a percona build (yet I&#039;d say, I&#039;m in the process of building a debian package out of the latest release).

I tried everything I could to diagnose this, including running with different debug allocator (like the google perftool) , or on top of valgrind. Unfortunately usually the server dies (because there is too much load) before giving much information.
So, yes maybe that&#039;s the dictionnary, because when we were running 4.0 (and much less load) we were a MyISAM only shop.
Thanks,
Brice</description>
		<content:encoded><![CDATA[<p>@Arjan,<br />
I don&#8217;t really know if it&#8217;s a memory leak but it didn&#8217;t happened when we were running under 4.0. I reported this issue around 5.0.27 to mysql, and they indeed find one memory leak. Unfortunately this didn&#8217;t fix my issue.<br />
We&#8217;re running with short lived connections, and with a wait timeout of 120s, since that was my first thought (I mean long lived connections from our game servers).</p>
<p>@Baron,<br />
Here is my mem status:</p>
<p>Total memory allocated 8751883484; in additional pool allocated 20926208<br />
Buffer pool size   458752<br />
&#8230;</p>
<p>Which mean per your formula:<br />
mysql&gt; select 8751883484 &#8211; (458752*16384) &#8211; 20926208;<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br />
| 8751883484 &#8211; (458752*16384) &#8211; 20926208 |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br />
|                             1214764508 |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+</p>
<p>That&#8217;s 1.2GB for 1.5 week of uptime, ouch.</p>
<p>We have about 300 innodb tables. But about 20 of them are truncated every 5s (not dropped) as they are used to compute online games rankings. Maybe that&#8217;s temporary table ending in the dictionnary?</p>
<p>I&#8217;m not running a percona build (yet I&#8217;d say, I&#8217;m in the process of building a debian package out of the latest release).</p>
<p>I tried everything I could to diagnose this, including running with different debug allocator (like the google perftool) , or on top of valgrind. Unfortunately usually the server dies (because there is too much load) before giving much information.<br />
So, yes maybe that&#8217;s the dictionnary, because when we were running 4.0 (and much less load) we were a MyISAM only shop.<br />
Thanks,<br />
Brice</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baron Schwartz</title>
		<link>http://www.mysqlperformanceblog.com/2009/02/12/how-much-memory-can-mysql-use-in-the-worst-case/comment-page-1/#comment-475215</link>
		<dc:creator>Baron Schwartz</dc:creator>
		<pubDate>Fri, 13 Feb 2009 14:03:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=625#comment-475215</guid>
		<description>Bruce,

Look at SHOW INNODB STATUS and see this part:

BUFFER POOL AND MEMORY
----------------------
Total memory allocated 17475088; in additional pool allocated 864256
Buffer pool size   512

Multiply the buffer pool size by the page size (or just check my.cnf) and subtract that and the additional pool from the total memory allocated.  For example,

mysql&gt; select 17475088 - (512 * 16384) - 864256;
+-----------------------------------+
&#124; 17475088 - (512 * 16384) - 864256 &#124;
+-----------------------------------+
&#124;                           8222224 &#124; 
+-----------------------------------+

Do you have a lot left over?  Sometimes the difference is gigabytes.  It&#039;s usually the data dictionary -- do you have tens of thousands of tables or more?

If that&#039;s not it, are you running a Percona patched build?  There was actually a memory leak in one of our patches a few releases back!  I can ask Vadim for the details... I forgot it already.</description>
		<content:encoded><![CDATA[<p>Bruce,</p>
<p>Look at SHOW INNODB STATUS and see this part:</p>
<p>BUFFER POOL AND MEMORY<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Total memory allocated 17475088; in additional pool allocated 864256<br />
Buffer pool size   512</p>
<p>Multiply the buffer pool size by the page size (or just check my.cnf) and subtract that and the additional pool from the total memory allocated.  For example,</p>
<p>mysql> select 17475088 &#8211; (512 * 16384) &#8211; 864256;<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| 17475088 &#8211; (512 * 16384) &#8211; 864256 |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
|                           8222224 |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+</p>
<p>Do you have a lot left over?  Sometimes the difference is gigabytes.  It&#8217;s usually the data dictionary &#8212; do you have tens of thousands of tables or more?</p>
<p>If that&#8217;s not it, are you running a Percona patched build?  There was actually a memory leak in one of our patches a few releases back!  I can ask Vadim for the details&#8230; I forgot it already.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
