<?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: Best Practices for Setting MySQL Server Runtime Parameters</title>
	<atom:link href="http://techlog.p2061.org/2008/05/07/optimizing-mysql-server-runtime-parameters/feed/" rel="self" type="application/rss+xml" />
	<link>http://techlog.p2061.org/2008/05/07/optimizing-mysql-server-runtime-parameters/</link>
	<description>Blogging from Project 2061 technology group</description>
	<lastBuildDate>Mon, 06 Jul 2009 14:57:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: BrianS</title>
		<link>http://techlog.p2061.org/2008/05/07/optimizing-mysql-server-runtime-parameters/comment-page-1/#comment-100</link>
		<dc:creator>BrianS</dc:creator>
		<pubDate>Mon, 23 Feb 2009 18:03:23 +0000</pubDate>
		<guid isPermaLink="false">http://techlog.p2061.org/2008/05/07/optimizing-mysql-server-runtime-parameters/#comment-100</guid>
		<description>Update after 164 days uptime:

After today&#039;s update I won&#039;t be providing further review. I think, for the most part, the decisions I made regarding the server settings have worked out well. There are a few settings that can still be tweaked, but I don&#039;t think any further discussion is necessary at this point. I will, however, make any notes on any extraordinary changes in server performance. I will also report on the effects of any query optimizations.

The thread cache is still at a good level. Current stats say 20 maximum concurrent connections with 18 cached and 100% hit rate.

I think the table cache may actually be at an acceptable level. The number of opened tables is still rising (currently at 870), but not as quickly as it appeared in the last review. It may still be worthwhile to increase the cache slightly, but I&#039;m not as concerned as I was initially.

Temporary tables still appears to be problematic. The percentage of temporary tables written to disk continues to rise (now at around 17.5%). Some of this is likely due to lack of query optimization, meaning a code review needs to be performed. That will have to wait until I have a chance to outline best practices for code development. In the meantime I&#039;m going to raise the values of tmp_table_size/max_heap_table_size from 32M to 48M.

The query cache performance is doing a little better than in the previous update with a 7:1 hit-to-insert ratio. We&#039;re still seeing a large number of prunes (35K) and free blocks (908). Still, these numbers aren&#039;t increasing horribly. This is still likely a problem of leaving out some queries, plus we should set up a cron job to flush the cache on a regular basis in order to keep the number of free blocks low.

The key buffer is fully used, but the key_reads/key_read_requests is still at an acceptable level (.001). It might be prudent to increase the buffer size, but I&#039;ll wait until next review to see how the buffer is holding up.

The read handlers are still alarmingly high. But again, until we spend some time optimizing queries I don&#039;t expect</description>
		<content:encoded><![CDATA[<p>Update after 164 days uptime:</p>
<p>After today&#8217;s update I won&#8217;t be providing further review. I think, for the most part, the decisions I made regarding the server settings have worked out well. There are a few settings that can still be tweaked, but I don&#8217;t think any further discussion is necessary at this point. I will, however, make any notes on any extraordinary changes in server performance. I will also report on the effects of any query optimizations.</p>
<p>The thread cache is still at a good level. Current stats say 20 maximum concurrent connections with 18 cached and 100% hit rate.</p>
<p>I think the table cache may actually be at an acceptable level. The number of opened tables is still rising (currently at 870), but not as quickly as it appeared in the last review. It may still be worthwhile to increase the cache slightly, but I&#8217;m not as concerned as I was initially.</p>
<p>Temporary tables still appears to be problematic. The percentage of temporary tables written to disk continues to rise (now at around 17.5%). Some of this is likely due to lack of query optimization, meaning a code review needs to be performed. That will have to wait until I have a chance to outline best practices for code development. In the meantime I&#8217;m going to raise the values of tmp_table_size/max_heap_table_size from 32M to 48M.</p>
<p>The query cache performance is doing a little better than in the previous update with a 7:1 hit-to-insert ratio. We&#8217;re still seeing a large number of prunes (35K) and free blocks (908). Still, these numbers aren&#8217;t increasing horribly. This is still likely a problem of leaving out some queries, plus we should set up a cron job to flush the cache on a regular basis in order to keep the number of free blocks low.</p>
<p>The key buffer is fully used, but the key_reads/key_read_requests is still at an acceptable level (.001). It might be prudent to increase the buffer size, but I&#8217;ll wait until next review to see how the buffer is holding up.</p>
<p>The read handlers are still alarmingly high. But again, until we spend some time optimizing queries I don&#8217;t expect</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BrianS</title>
		<link>http://techlog.p2061.org/2008/05/07/optimizing-mysql-server-runtime-parameters/comment-page-1/#comment-15</link>
		<dc:creator>BrianS</dc:creator>
		<pubDate>Tue, 14 Oct 2008 19:19:19 +0000</pubDate>
		<guid isPermaLink="false">http://techlog.p2061.org/2008/05/07/optimizing-mysql-server-runtime-parameters/#comment-15</guid>
		<description>32-day report:
A lot of the numbers appear to be worse than I was expecting given the early update. However, I won&#039;t be making any changes until the three-month update; mainly because the import of the pilot test data may be having a detrimental affect on the number reported.

Cached threads is still pushing upward (currently at 20 created; 17 cached, 3 in use), but I&#039;m going to leave this at 25 for now. This is something that won&#039;t really hurt us if we go over, so I&#039;ll wait until we get closer to the setting.

Opened tables is still rising, despite a table cache of 256. Right now it&#039;s at 556. I think it may be worthwhile to increase the table cache, but we&#039;ll see how things look at the next review.

The number of temporary tables being written to disk is a little over 10% of the total number of temporary tables. This isn&#039;t as good as the numbers seen in the previous update so it&#039;s worth watching. If the numbers don&#039;t improve the value of tmp_table_size/max_head_table_size should be increased.

The query cache is not performing quite as well as in the previous update. It&#039;s at roughly a 4:1 hit-to-insert ratio (1,652k/427k). Plus, the value in lowmem_prunes is high (19K) and the number of free blocks is also high (368). I&#039;m going to flush the cache and see if the numbers improve. There&#039;s no need to increase the size of the cache, though, since it&#039;s not being fully used. These numbers may have more to do with caching of queries that would best be left out, which is something that can be controlled when issuing a query.

The key buffer still appears to be at an appropriate value. However, the number of blocks used is starting to push against the size of the buffer. This should probably be increased on the next update.

The sort buffer appears to be acceptable.

The read handlers are still fairly high, but queries have not yet been optimized so this is something that may see improvement without further changes to the server settings.</description>
		<content:encoded><![CDATA[<p>32-day report:<br />
A lot of the numbers appear to be worse than I was expecting given the early update. However, I won&#8217;t be making any changes until the three-month update; mainly because the import of the pilot test data may be having a detrimental affect on the number reported.</p>
<p>Cached threads is still pushing upward (currently at 20 created; 17 cached, 3 in use), but I&#8217;m going to leave this at 25 for now. This is something that won&#8217;t really hurt us if we go over, so I&#8217;ll wait until we get closer to the setting.</p>
<p>Opened tables is still rising, despite a table cache of 256. Right now it&#8217;s at 556. I think it may be worthwhile to increase the table cache, but we&#8217;ll see how things look at the next review.</p>
<p>The number of temporary tables being written to disk is a little over 10% of the total number of temporary tables. This isn&#8217;t as good as the numbers seen in the previous update so it&#8217;s worth watching. If the numbers don&#8217;t improve the value of tmp_table_size/max_head_table_size should be increased.</p>
<p>The query cache is not performing quite as well as in the previous update. It&#8217;s at roughly a 4:1 hit-to-insert ratio (1,652k/427k). Plus, the value in lowmem_prunes is high (19K) and the number of free blocks is also high (368). I&#8217;m going to flush the cache and see if the numbers improve. There&#8217;s no need to increase the size of the cache, though, since it&#8217;s not being fully used. These numbers may have more to do with caching of queries that would best be left out, which is something that can be controlled when issuing a query.</p>
<p>The key buffer still appears to be at an appropriate value. However, the number of blocks used is starting to push against the size of the buffer. This should probably be increased on the next update.</p>
<p>The sort buffer appears to be acceptable.</p>
<p>The read handlers are still fairly high, but queries have not yet been optimized so this is something that may see improvement without further changes to the server settings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BrianS</title>
		<link>http://techlog.p2061.org/2008/05/07/optimizing-mysql-server-runtime-parameters/comment-page-1/#comment-9</link>
		<dc:creator>BrianS</dc:creator>
		<pubDate>Tue, 27 May 2008 21:06:39 +0000</pubDate>
		<guid isPermaLink="false">http://techlog.p2061.org/2008/05/07/optimizing-mysql-server-runtime-parameters/#comment-9</guid>
		<description>11-day report:
The settings I&#039;ve implemented definitely seem to be helping with database performance.

My assumption of the max number of concurrent connections appears to be fairly close. So far we&#039;ve hit a concurrent connection max of 16. I&#039;m not sure how MySQL determines when to cache a thread, but our thread cache is only at 8. Probably related to thread age, but something that should be researched.

I&#039;m going to lower the maximum connections to 50 (from the default of 100). We&#039;re not coming anywhere near 100 and since the purpose of this setting is to prevent resource depletion it&#039;s better to play safe than sorry. At some point in the future we should calculate the maximum per-connection resource usage and adjust this setting based on that information.

The query cache seems to be performing well with what appears to be a high hit/insert ratio (1,179K/31K). It has plenty of free memory after 11 days of usage and no low memory prunes. It does show some modest fragmentation as indicated by qcache_free_blocks having a value of 47.

The key buffer setting also appears to be acceptable. Our key_reads/key_read_requests is still significantly below the .01 ceiling recommended by MySQL.

For the number of temporary tables created (148K) we&#039;re not looking too bad on the number that had to be written to disk (1,840).

The table cache appears to be doing well, though still not being used fully. Again something that might relate to pruning by MySQL based on age, but I&#039;ll need to research this more as well.

The one number that is disconcerting in the stats is handler_read_rnd_next with a value of 538M. The documentation states that a high value here probably indicates that tables indexes are not optimal for the queries being run. This is also bourne out by the values of select_full_join and select_scan. We should spend some time analyzing our queries to determine where optimizations can be made.

Next update at around one month.</description>
		<content:encoded><![CDATA[<p>11-day report:<br />
The settings I&#8217;ve implemented definitely seem to be helping with database performance.</p>
<p>My assumption of the max number of concurrent connections appears to be fairly close. So far we&#8217;ve hit a concurrent connection max of 16. I&#8217;m not sure how MySQL determines when to cache a thread, but our thread cache is only at 8. Probably related to thread age, but something that should be researched.</p>
<p>I&#8217;m going to lower the maximum connections to 50 (from the default of 100). We&#8217;re not coming anywhere near 100 and since the purpose of this setting is to prevent resource depletion it&#8217;s better to play safe than sorry. At some point in the future we should calculate the maximum per-connection resource usage and adjust this setting based on that information.</p>
<p>The query cache seems to be performing well with what appears to be a high hit/insert ratio (1,179K/31K). It has plenty of free memory after 11 days of usage and no low memory prunes. It does show some modest fragmentation as indicated by qcache_free_blocks having a value of 47.</p>
<p>The key buffer setting also appears to be acceptable. Our key_reads/key_read_requests is still significantly below the .01 ceiling recommended by MySQL.</p>
<p>For the number of temporary tables created (148K) we&#8217;re not looking too bad on the number that had to be written to disk (1,840).</p>
<p>The table cache appears to be doing well, though still not being used fully. Again something that might relate to pruning by MySQL based on age, but I&#8217;ll need to research this more as well.</p>
<p>The one number that is disconcerting in the stats is handler_read_rnd_next with a value of 538M. The documentation states that a high value here probably indicates that tables indexes are not optimal for the queries being run. This is also bourne out by the values of select_full_join and select_scan. We should spend some time analyzing our queries to determine where optimizations can be made.</p>
<p>Next update at around one month.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
