<?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>MySQL Fanboy &#187; Tunning</title>
	<atom:link href="/tag/tunning/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlfanboy.com</link>
	<description>Almost crazy about Opensource / Free  information.</description>
	<lastBuildDate>Sun, 01 Aug 2010 18:50:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Does Size or Type Matter?</title>
		<link>http://www.mysqlfanboy.com/2010/07/does-size-or-type-matter/</link>
		<comments>http://www.mysqlfanboy.com/2010/07/does-size-or-type-matter/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 18:08:16 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Tunning]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Profilling]]></category>
		<category><![CDATA[Query]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.mysqlfanboy.com/?p=238</guid>
		<description><![CDATA[MySQL seems to be happy to convert types for you. Developers are rushed to complete their project and if the function works they just move on. But what is the costs of mixing your types? Does it matter if your are running across a million rows or more? Lets find out. Here is what the [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL seems to be happy to convert types for you.  Developers are rushed to complete their project and if the function works they just move on.  But what is the costs of mixing your types?  Does it matter if your are running across a million rows or more?  Lets find out.</p>
<p>Here is what the programmers see.</p>
<pre style="padding-left: 30px;">mysql&gt; select <span style="color: #ff0000;"><strong>1+1</strong></span>;
+-----+
| 1+1 |
+-----+
|   2 |
+-----+
1 row in set (<span style="color: #008000;">0.00 sec</span>)

mysql&gt; select <span style="color: #ff0000;"><strong>"1"+"1"</strong></span>;
+---------+
| "1"+"1" |
+---------+
|       2 |
+---------+
1 row in set (<span style="color: #008000;">0.00 sec</span>)</pre>
<p><strong>Benchmark</strong></p>
<p>What if we do a thousand simple loops?  How long does the looping itself take?<strong> </strong></p>
<p>The <a href="http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_benchmark"><code>BENCHMARK()</code></a> function           executes the expression <em><code>expr</code></em> repeatedly <em><code>count</code></em> times. It may be           used to time how quickly MySQL processes the expression. The           result value is always <code>0</code>.</p>
<pre>
<pre style="padding-left: 30px;">mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;"><strong>1</strong></span>);
+--------------------------+
| benchmark(1000000000, 1) |
+--------------------------+
|                        0 |
+--------------------------+
1 row in set (<span style="color: #008000;">5.42 sec</span>)

mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;"><strong>"1"</strong></span> );
+-----------------------------+
| benchmark(1000000000, "1" ) |
+-----------------------------+
|                           0 |
+-----------------------------+
1 row in set (<span style="color: #008000;">5.40 sec</span>)</pre>
</pre>
<p>So maybe type doesn&#8217;t matter? About five seconds just to loop but the type didn&#8217;t change it.   What if we add <span style="color: #ff0000;"><strong>1+&#8221;1&#8243;</strong></span>?</p>
<p><span id="more-238"></span></p>
<pre style="padding-left: 30px;">mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;"><strong>1+1</strong></span>);
+----------------------------+
| benchmark(1000000000, 1+1) |
+----------------------------+
|                          0 |
+----------------------------+
1 row in set (<span style="color: #008000;">12.65 sec</span>)

mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;"><strong>1+"1"</strong></span>);
+------------------------------+
| benchmark(1000000000, 1+"1") |
+------------------------------+
|                            0 |
+------------------------------+
1 row in set (<span style="color: #008000;">35.58 sec</span>)
<pre>mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;"><strong>"1"+"1"</strong></span>);
+--------------------------------+
| benchmark(1000000000, "1"+"1") |
+--------------------------------+
|                              0 |
+--------------------------------+
1 row in set (<span style="color: #008000;">51.59 sec</span>)</pre>
<p>It looks like type does matter.  But does it always matter?</p>
<pre style="padding-left: 30px;">mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;">sum(1+1)</span>);
+---------------------------------+
| benchmark(1000000000, sum(1+1)) |
+---------------------------------+
|                               0 |
+---------------------------------+
1 row in set (<span style="color: #008000;">9.69 sec</span>)

mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;">sum("1"+"1")</span>);
+-------------------------------------+
| benchmark(1000000000, sum("1"+"1")) |
+-------------------------------------+
|                                   0 |
+-------------------------------------+
1 row in set (<span style="color: #008000;">9.94 sec</span>)

mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;">sum("1.23456789"+"1.23456789")</span>);
+-------------------------------------------------------+
| benchmark(1000000000, sum("1.23456789"+"1.23456789")) |
+-------------------------------------------------------+
|                                                     0 |
+-------------------------------------------------------+
1 row in set (<span style="color: #008000;">10.32 sec</span>)</pre>
<p>So, not all functions are the same.  But it looks like size might matter!</p>
<pre style="padding-left: 30px;">mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;">1.1+1.1</span>);
+--------------------------------+
| benchmark(1000000000, 1.1+1.1) |
+--------------------------------+
|                              0 |
+--------------------------------+
1 row in set (<span style="color: #008000;">34.90 sec</span>)

mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;">"1.1"+"1.1"</span>);
+------------------------------------+
| benchmark(1000000000, "1.1"+"1.1") |
+------------------------------------+
|                                  0 |
+------------------------------------+
1 row in set (<span style="color: #008000;">1 min 15.32 sec</span>)

mysql&gt; select  benchmark(1000000000, <span style="color: #ff0000;">"1.123456789"+"1.123456789"</span>);
+----------------------------------------------------+
| benchmark(1000000000, "1.123456789"+"1.123456789") |
+----------------------------------------------------+
|                                                  0 |
+----------------------------------------------------+
1 row in set (<span style="color: #008000;">1 min 53.32 sec</span>)</pre>
<p>Sorry.  Looks like size does matter.<br />
This doesn't seem logical.</p>
<pre>mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;">1=1</span>);
+----------------------------+
| benchmark(1000000000, 1=1) |
+----------------------------+
|                          0 |
+----------------------------+
1 row in set (<span style="color: #008000;">12.75 sec</span>)

mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;">1="1"</span>);
+------------------------------+
| benchmark(1000000000, 1="1") |
+------------------------------+
|                            0 |
+------------------------------+
1 row in set (<span style="color: #008000;">40.78 sec</span>)
mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;">1=true</span>);
+-------------------------------+
| benchmark(1000000000, 1=true) |
+-------------------------------+
|                             0 |
+-------------------------------+
1 row in set (<span style="color: #008000;">12.73 sec</span>)

mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;">1="true"</span>);
+---------------------------------+
| benchmark(1000000000, 1="true") |
+---------------------------------+
|                               0 |
+---------------------------------+
1 row in set, <span style="color: #ff0000;">65535 warnings</span> (<span style="color: #008000;">3 min 5.72 sec</span>)
mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;">"true"="true"</span>);
+--------------------------------------+
| benchmark(1000000000, "true"="true") |
+--------------------------------------+
|                                    0 |
+--------------------------------------+
1 row in set (<span style="color: #008000;">57.25 sec</span>)</pre>
<p>Maybe we should CAST our work?</p>
<pre style="padding-left: 30px;">mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;">cast("1" as unsigned)</span>);
+----------------------------------------------+
| benchmark(1000000000, cast("1" as unsigned)) |
+----------------------------------------------+
|                                            0 |
+----------------------------------------------+
1 row in set (<span style="color: #008000;">32.27 sec</span>)

mysql&gt; select benchmark(1000000000, <span style="color: #ff0000;">cast("1" as unsigned) + cast("1" as unsigned)</span>);
+----------------------------------------------------------------------+
| benchmark(1000000000, cast("1" as unsigned) + cast("1" as unsigned)) |
+----------------------------------------------------------------------+
|                                                                    0 |
+----------------------------------------------------------------------+
1 row in set (<span style="color: #008000;">1 min 7.24 sec</span>)</pre>
</pre>
<p>Maybe not!<br />
Conclusion:  Be careful with your data types.  If you are taking user input, do the type conversion ONCE in your program.  Don&#8217;t let MySQL do the type conversions for you.<br />
query = &#8220;SELECT * FROM table where $INPUT = 1&#8243;;   could be doing your wrong.<br />
<img class="alignnone" src="http://mark.grennan.com/images/MarkGrennanSigniture.bmp" alt="" width="166" height="69" /></p>
<pre>References:

http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_benchmark

http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html

http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mysqlfanboy.com/2010/07/does-size-or-type-matter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Network Connections</title>
		<link>http://www.mysqlfanboy.com/2010/05/mysql-network-connections/</link>
		<comments>http://www.mysqlfanboy.com/2010/05/mysql-network-connections/#comments</comments>
		<pubDate>Fri, 07 May 2010 20:59:39 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Tunning]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Settings]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.mysqlfanboy.com/?p=139</guid>
		<description><![CDATA[If your MySQL server has hundreds of clients (applications) and tens of thousands of queries per second,  MySQL default network settings may NOT be for you.  Network performance is not often a significant factor in the performance of MySQL.  That said, there are things to consider. If you are building new applications make these changes [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/wp-content/uploads/2010/05/small-Clipboard01.jpg"><img class="alignright size-full wp-image-208" title="small-Clipboard01" src="/wp-content/uploads/2010/05/small-Clipboard01.jpg" alt="" width="256" height="170" /></a>If your MySQL server has hundreds of clients (applications) and tens  of thousands of queries per second,  MySQL default network settings may <strong>NOT </strong>be for you.  Network performance is not often a significant factor  in the performance of MySQL.  That said, there are things to consider.</p>
<p>If you are building new applications make these changes now.   Developer expectations are hard to change.  My example below will break  your application if  developers open a database connections and then  spend ten minutes playing with their play doe before making a query.  If  you have working applications make changes slowly.</p>
<p><a href="http://en.wikipedia.org/wiki/Middleware">Middleware</a> provides database <a href="http://en.wikipedia.org/wiki/Connection_pool">connections  pooling</a>. This allows database connections to be used by multiple  applications. Any program that runs as a deamon or service can use  database pooling using <a href="http://libdbi.sourceforge.net/download.html">libdbi</a>.  Applications written in PHP or CGI code don&#8217;t pool DB connections. They  open and closes the connection each time a user hit a page.</p>
<p>The Apache module mod_dbd can manages database connections.  On  non-threaded platforms,     it provides a persistent connection. On  threaded platform, it provides an altogether more     scalable and  efficient <em>connection pool</em>, as     described in <a href="http://www.apachetutor.org/dev/reslist">this     article at  ApacheTutor</a>.  Note that <code><a href="http://httpd.apache.org/docs/2.1/mod/mod_dbd.html">mod_dbd</a></code> supersedes the modules presented in that article.</p>
<p>PHP provides <a href="http://php.net/manual/en/function.mysql-pconnect.php">mysql_pconnect</a>.  It first tries to find a    (persistent) link that&#8217;s already open with  the same host,    username and password (NOT PORT).  If one is found, an  identifier for it    will be returned instead of opening a new  connection.  Second, the connection to the SQL server will not be closed  when    the execution of the script ends.  Instead, the link will  remain    open for future use (<a href="http://www.php.net/manual/en/function.mysql-close.php">mysql_close()</a> will not    close links established by <strong>mysql_pconnect()</strong>).</p>
<p>Back to MySQL.</p>
<p><strong>Max Connections</strong> has a default of <strong>100</strong> (&lt;= 5.1.14) to <strong>151</strong> (&gt;= 5.1.15).  If you exceed this number you will receive a &#8220;Too many  connections error&#8221;.  This is often the first setting people find they  have to changed as their usage grows.</p>
<p><strong>Max User Connections</strong> controls the maximum number of  simultaneous connections allowed per MySQL user  account. By default this is set to unlimited (zero).  The default is  fine. Your system will not run out of connections or memory if you have  set Max Connections correctly.  Except a bad applications can &#8220;steel&#8221;  all the connections from all the others.   Hopefully you have assigned a  different user for each application.  Set this to the maximum number of  connections any given  user (application) will make.</p>
<p><strong>Wait  timeout</strong> is the number of seconds the server waits for activity on a            non-interactive connection before closing it. The default is  eight hours. (28800 seconds)  This is a crazy amount of time.  How long  would you stay on the phone if no one was speaking?  Fifteen seconds is a  good place to start. If it gives you problems increase it by fifteen  until your good. Applications that open a connections and then process  their data for minutes before making a request will be effected by a  short time setting.</p>
<p><strong>Interactive timeout</strong> is the number of seconds the server waits  for activity on an interactive connection before closing it. This is  only used by applications using the  <a title="21.9.3.52. mysql_real_connect()" href="http://dev.mysql.com/doc/refman/5.1/en/mysql-real-connect.html"> mysql_real_connect()</a> function of the MySQL API. I set this to 600.  My idea is to give more sophisticated users more grace.  (Think connection pools have to reconnect.)</p>
<p><strong>Connect timeout</strong> is the number of seconds that the MySQL server  waits for a connect packet before responding with Bad handshake. The  default is ten seconds.  Five would be better.</p>
<p><strong>Max connections errors</strong> is a strange setting. IO stops after  this number of bad connections is made from a host. You can unblock  blocked hosts with the           <a title="12.4.6.3. FLUSH Syntax" href="http://dev.mysql.com/doc/refman/5.1/en/flush.html"><code>FLUSH  HOSTS</code></a> statement.  The default for this is ten (10). On a &#8220;good&#8221; network this shouldn&#8217;t have to be changed.  Because &#8220;the dabase should never stop&#8221; most DBAs make this a very large number. If you  have a over loaded network you should put your database on a network of  its own.  Or, you can try increasing this value.</p>
<p><strong>max_allowed_packet</strong> controls the size of your BLOBs.  If you are storing pictures in your database, you may  need to set this.  The default is one megabyte (1M). The           protocol limit for           <code>max_allowed_packet</code> is 1GB.            Set it to the biggest           <a title="10.4.3. The BLOB  and          TEXT Types" href="http://dev.mysql.com/doc/refman/5.1/en/blob.html"><code>BLOB</code></a> you need to store. The value should be a multiple of 1024 bytes.</p>
<p>Here are my my.cnf settings for a server with over 200 PHP and Perl  applications and peeking at 4,000 connections per second.</p>
<pre># Network management
port                    = 3306
max_connections         = 5000  # number of simultaneous client connections allowed
max_user_connections    = 200   # number of connections a user can make, 0 = Unlimited
wait_timeout            = 15    # seconds to waits for activity on non interactive connection
interactive_timeout     = 600   # seconds to waits for activity on interactive connection
connect_timeout         = 5     # on connect seconds to waits for a connect packet
max_connect_errors      = 1000000 # IO stops after this number of bad connections one good connect reset
max_allowed_packet      = 10M   # How big is your BLOB?</pre>
<p><img title="Mark Grennan" src="http://mark.grennan.com/images/MarkGrennanSigniture.bmp" alt="Mark Grennan" width="166" height="69" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mysqlfanboy.com/2010/05/mysql-network-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL master/slave support merged into Linux-HA</title>
		<link>http://www.mysqlfanboy.com/2010/04/mysql-masterslave-support-merged-into-linux-ha/</link>
		<comments>http://www.mysqlfanboy.com/2010/04/mysql-masterslave-support-merged-into-linux-ha/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 21:07:12 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tunning]]></category>

		<guid isPermaLink="false">http://www.mysqlfanboy.com/?p=105</guid>
		<description><![CDATA[(Re-posted from Florian&#8217;s blog.) MySQL replication support for the Pacemaker cluster manager (the stuff that we explained in this webinar) has made it into the Linux-HA resource agents default branch. If you are interested in testing — and you should! — please read the extended announcement. Feedback is extremely welcome on the linux-ha-dev mailing list. [...]]]></description>
			<content:encoded><![CDATA[<p>(Re-posted from <a href="http://fghaas.wordpress.com/">Florian&#8217;s blog</a>.)</p>
<p><a href="http://dev.mysql.com/doc/refman/5.0/en/replication.html">MySQL  replication</a> support for the <a href="http://www.clusterlabs.org/">Pacemaker</a> cluster manager (the stuff that we explained in <a href="http://fghaas.wordpress.com/2010/04/08/mysqlpacemaker-scaleout-webinar-recording-available/">this  webinar</a>) <a href="http://hg.linux-ha.org/agents/rev/82206c4818dc">has  made it</a> into the Linux-HA resource agents default branch. If you  are interested in testing — and you should! — please read the <a href="http://lists.linux-ha.org/pipermail/linux-ha-dev/2010-April/017350.html">extended  announcement</a>. Feedback is extremely welcome on <a href="http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev">the  linux-ha-dev mailing list</a>.</p>
<p>We are expecting to release this as part of resource-agents 1.0.4, in  late May/early June.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mysqlfanboy.com/2010/04/mysql-masterslave-support-merged-into-linux-ha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Single Query Profiling</title>
		<link>http://www.mysqlfanboy.com/2010/02/single-query-profiling/</link>
		<comments>http://www.mysqlfanboy.com/2010/02/single-query-profiling/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 20:21:29 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Profilling]]></category>
		<category><![CDATA[Query]]></category>
		<category><![CDATA[Tunning]]></category>

		<guid isPermaLink="false">http://www.mysqlfanboy.com/?p=6</guid>
		<description><![CDATA[Every wounder what was taking MySQL so long to run your query.  You can ask it. mysql &#62; set profiling=1; mysql&#62; SELECT * FROM country WHERE city like &#8216;okla&#8217;  order by name; mysql&#62; SHOW PROFILES; You should now see a table with a single row, with the number 1 to the left of your query. [...]]]></description>
			<content:encoded><![CDATA[<p>Every wounder what was taking MySQL so long to run your query.  You can ask it.</p>
<p>mysql &gt; <em><strong>set profiling=1;</strong></em><br />
mysql&gt; <em><strong>SELECT * FROM country WHERE city like &#8216;okla&#8217;  order by name; </strong></em><br />
mysql&gt; <em><strong>SHOW PROFILES;</strong></em></p>
<p>You should now see a table with a single row, with the number 1 to the left of your query.</p>
<p>mysql&gt; <em><strong>SHOW PROFILE FOR QUERY 1;</strong></em></p>
<p><span id="more-6"></span>There is more and you can read about it at</p>
<p>You&#8217;ll see a table summarizing how long each stage of executing the query took:</p>
<pre>+--------------------------------+----------+
| Status                         | Duration |
+--------------------------------+----------+
| starting                       | 0.000050 |
| checking query cache for query | 0.000102 |
| Opening tables                 | 0.018733 |
| System lock                    | 0.000010 |
| Table lock                     | 0.000006 |
| init                           | 0.007367 |
| optimizing                     | 0.000004 |
| statistics                     | 0.000006 |
| preparing                      | 0.000005 |
| executing                      | 0.000002 |
| Sorting result                 | 0.027435 |
| Sending data                   | 0.000023 |
| end                            | 0.000002 |
| query end                      | 0.000002 |
| freeing items                  | 0.000031 |
| logging slow query             | 0.000002 |
| cleaning up                    | 0.000001 |
+--------------------------------+----------+
16 rows in set (0.00 sec)</pre>
<p>To turn profiling off</p>
<p>mysql&gt; <strong><em>set profiling=0; </em></strong></p>
<p>There is more and you can read about it at<strong> </strong><a title="http://dev.mysql.com/tech-resources/articles/using-new-query-profiler.html" href="http://dev.mysql.com/tech-resources/articles/using-new-query-profiler.html">http://dev.mysql.com/tech-resources/articles/using-new-query-profiler.htm.</a></p>
<p><img class="alignnone" src="http://mark.grennan.com/images/MarkGrennanSigniture.bmp" alt="" width="166" height="69" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mysqlfanboy.com/2010/02/single-query-profiling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Table Caching</title>
		<link>http://www.mysqlfanboy.com/2010/02/mysql-table-caching/</link>
		<comments>http://www.mysqlfanboy.com/2010/02/mysql-table-caching/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 01:26:45 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[Caching]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Table]]></category>
		<category><![CDATA[Tunning]]></category>

		<guid isPermaLink="false">http://www.mysqlfanboy.com/?p=5</guid>
		<description><![CDATA[Too much of a good thing&#8230; I have had a lot of people asking me about MySQL lately so I thought is was time to share something I learned.  Too much caching space in MySQL can be a bad thing. You would thing the more you can stuff your entire database into memory the better [...]]]></description>
			<content:encoded><![CDATA[<p>Too much of a good thing&#8230;</p>
<p>I have had a lot of people asking me about MySQL lately so I thought is was time to share something I learned.  Too much caching space in MySQL can be a bad thing.</p>
<p>You would thing the more you can stuff your entire database into memory the better off you would be and the faster your system would work.  That is not completely true. I have made mprovements by lowering <strong>table_cache</strong> variable on every version my MySQL 5. From what I have read this seems to be due to overhead managing file descriptors and caching tables.  Like most things there is a point of diminishing returns when dealing with cache tables.  At some point your hit rate is overtaken by the management threads.</p>
<p>This seems to work best.  The read_rnd should be four times the sort and join buffer and they are four times the read buffer.  Something like this;</p>
<p>sort_buffer_size        = 16M<br />
read_buffer_size        = 4M<br />
read_rnd_buffer_size    = 64M<br />
join_buffer_size        = 16M</p>
<p>Send me feedback at Mark at Grennan.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mysqlfanboy.com/2010/02/mysql-table-caching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
