<?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: To find the bottleneck, stop guessing and start measuring</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2008/08/04/to-find-the-bottleneck-stop-guessing-and-start-measuring/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2008/08/04/to-find-the-bottleneck-stop-guessing-and-start-measuring/</link>
	<description>Everything about MySQL Performance</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:23:57 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jim Murphy</title>
		<link>http://www.mysqlperformanceblog.com/2008/08/04/to-find-the-bottleneck-stop-guessing-and-start-measuring/comment-page-1/#comment-344365</link>
		<dc:creator>Jim Murphy</dc:creator>
		<pubDate>Wed, 13 Aug 2008 14:04:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=415#comment-344365</guid>
		<description>I appreciate that.  I&#039;ve been reading you book on Safari-Online and will head tot he forums.  Thanks for the help.

Jim</description>
		<content:encoded><![CDATA[<p>I appreciate that.  I&#8217;ve been reading you book on Safari-Online and will head tot he forums.  Thanks for the help.</p>
<p>Jim</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baron Schwartz</title>
		<link>http://www.mysqlperformanceblog.com/2008/08/04/to-find-the-bottleneck-stop-guessing-and-start-measuring/comment-page-1/#comment-344362</link>
		<dc:creator>Baron Schwartz</dc:creator>
		<pubDate>Wed, 13 Aug 2008 13:43:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=415#comment-344362</guid>
		<description>Jim,

I don&#039;t want to go deeper on this in a comments thread, but you could take it to our forums.  If you have time, you will probably find the help you need in our book.  And if you have money but not time, you can hire us :)</description>
		<content:encoded><![CDATA[<p>Jim,</p>
<p>I don&#8217;t want to go deeper on this in a comments thread, but you could take it to our forums.  If you have time, you will probably find the help you need in our book.  And if you have money but not time, you can hire us <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Murphy</title>
		<link>http://www.mysqlperformanceblog.com/2008/08/04/to-find-the-bottleneck-stop-guessing-and-start-measuring/comment-page-1/#comment-344360</link>
		<dc:creator>Jim Murphy</dc:creator>
		<pubDate>Wed, 13 Aug 2008 13:37:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=415#comment-344360</guid>
		<description>Thanks Baron,

It appears to me that disk is pretty close to saturated:


avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.51    0.00    0.20   54.55    0.00   44.73

Device:         rrqm/s   wrqm/s   r/s   w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
sdb             255.00   221.80 70.60 49.00  2580.80  2159.00    39.63     3.88   32.34   7.66  91.60
sdc             235.20   216.80 65.40 47.80  2360.00  2104.60    39.44     3.82   33.53   7.23  81.80
dm-0              0.00     0.00 628.00 535.20  5024.00  4263.60     7.98    39.04   33.41   0.85  99.20


So what to do when you MySQL queries are IO bound?  Any query hints to help it do less work?

Thanks for the advice,

Jim</description>
		<content:encoded><![CDATA[<p>Thanks Baron,</p>
<p>It appears to me that disk is pretty close to saturated:</p>
<p>avg-cpu:  %user   %nice %system %iowait  %steal   %idle<br />
           0.51    0.00    0.20   54.55    0.00   44.73</p>
<p>Device:         rrqm/s   wrqm/s   r/s   w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util<br />
sdb             255.00   221.80 70.60 49.00  2580.80  2159.00    39.63     3.88   32.34   7.66  91.60<br />
sdc             235.20   216.80 65.40 47.80  2360.00  2104.60    39.44     3.82   33.53   7.23  81.80<br />
dm-0              0.00     0.00 628.00 535.20  5024.00  4263.60     7.98    39.04   33.41   0.85  99.20</p>
<p>So what to do when you MySQL queries are IO bound?  Any query hints to help it do less work?</p>
<p>Thanks for the advice,</p>
<p>Jim</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baron Schwartz</title>
		<link>http://www.mysqlperformanceblog.com/2008/08/04/to-find-the-bottleneck-stop-guessing-and-start-measuring/comment-page-1/#comment-344182</link>
		<dc:creator>Baron Schwartz</dc:creator>
		<pubDate>Wed, 13 Aug 2008 03:39:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=415#comment-344182</guid>
		<description>Jim, sure. Start iostat -dx 5, and in another terminal start vmstat 5.  Then run the query and watch the iostat/vmstat output.  Read the man pages for these tools if you aren&#039;t familiar with their output.</description>
		<content:encoded><![CDATA[<p>Jim, sure. Start iostat -dx 5, and in another terminal start vmstat 5.  Then run the query and watch the iostat/vmstat output.  Read the man pages for these tools if you aren&#8217;t familiar with their output.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Murphy</title>
		<link>http://www.mysqlperformanceblog.com/2008/08/04/to-find-the-bottleneck-stop-guessing-and-start-measuring/comment-page-1/#comment-344181</link>
		<dc:creator>Jim Murphy</dc:creator>
		<pubDate>Wed, 13 Aug 2008 03:36:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=415#comment-344181</guid>
		<description>Oh - Liked the way this started but I didn&#039;t go the way I wanted - to solving my particular problem that is. :)

I have a simple table with lots of data some 60 million rows.  Queries take a long, long time though CPU is low - never getting above 4%.  What should I start measuring?  What can I check to know if its I/O bound or what the bottleneck is?

Table Described:

+-----------------+----------------------+------+-----+---------------------+----------------+
&#124; Field           &#124; Type                 &#124; Null &#124; Key &#124; Default             &#124; Extra          &#124;
+-----------------+----------------------+------+-----+---------------------+----------------+
&#124; id              &#124; int(11)              &#124; NO   &#124; PRI &#124; NULL                &#124; auto_increment &#124; 
&#124; title           &#124; varchar(255)         &#124; YES  &#124;     &#124; NULL                &#124;                &#124; 
&#124; description     &#124; text                 &#124; YES  &#124;     &#124; NULL                &#124;                &#124; 
&#124; full_story      &#124; text                 &#124; YES  &#124;     &#124; NULL                &#124;                &#124; 
&#124; uri             &#124; varchar(255)         &#124; YES  &#124; MUL &#124; NULL                &#124;                &#124; 
&#124; pubdate         &#124; datetime             &#124; YES  &#124;     &#124; 0000-00-00 00:00:00 &#124;                &#124; 
&#124; pubdate_reverse &#124; int(9)               &#124; YES  &#124;     &#124; NULL                &#124;                &#124; 
&#124; feed_id         &#124; int(5)               &#124; YES  &#124; MUL &#124; NULL                &#124;                &#124; 
+-----------------+----------------------+------+-----+---------------------+----------------+

The Query:

Select id, title, uri, pubdate from entries where feed_id = 151 order by pubdate_reverse limit 1000;

1000 rows in set (3 min 34.11 sec)


The explain:

+----+-------------+---------+------+-------------------+-------------------+---------+-------+-------+-------------+
&#124; id &#124; select_type &#124; table   &#124; type &#124; possible_keys     &#124; key               &#124; key_len &#124; ref   &#124; rows  &#124; Extra       &#124;
+----+-------------+---------+------+-------------------+-------------------+---------+-------+-------+-------------+
&#124;  1 &#124; SIMPLE      &#124; entries &#124; ref  &#124; index_feed_recent &#124; index_feed_recent &#124; 5       &#124; const &#124; 18032 &#124; Using where &#124; 
+----+-------------+---------+------+-------------------+-------------------+---------+-------+-------+-------------+
1 row in set (0.00 sec)


Hints?  

Best,

Jim</description>
		<content:encoded><![CDATA[<p>Oh &#8211; Liked the way this started but I didn&#8217;t go the way I wanted &#8211; to solving my particular problem that is. <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I have a simple table with lots of data some 60 million rows.  Queries take a long, long time though CPU is low &#8211; never getting above 4%.  What should I start measuring?  What can I check to know if its I/O bound or what the bottleneck is?</p>
<p>Table Described:</p>
<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;+&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;-+<br />
| Field           | Type                 | Null | Key | Default             | Extra          |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;+&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;-+<br />
| id              | int(11)              | NO   | PRI | NULL                | auto_increment |<br />
| title           | varchar(255)         | YES  |     | NULL                |                |<br />
| description     | text                 | YES  |     | NULL                |                |<br />
| full_story      | text                 | YES  |     | NULL                |                |<br />
| uri             | varchar(255)         | YES  | MUL | NULL                |                |<br />
| pubdate         | datetime             | YES  |     | 0000-00-00 00:00:00 |                |<br />
| pubdate_reverse | int(9)               | YES  |     | NULL                |                |<br />
| feed_id         | int(5)               | YES  | MUL | NULL                |                |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;+&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;-+</p>
<p>The Query:</p>
<p>Select id, title, uri, pubdate from entries where feed_id = 151 order by pubdate_reverse limit 1000;</p>
<p>1000 rows in set (3 min 34.11 sec)</p>
<p>The explain:</p>
<p>+&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+&#8212;&#8212;-+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+<br />
| id | select_type | table   | type | possible_keys     | key               | key_len | ref   | rows  | Extra       |<br />
+&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+&#8212;&#8212;-+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+<br />
|  1 | SIMPLE      | entries | ref  | index_feed_recent | index_feed_recent | 5       | const | 18032 | Using where |<br />
+&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+&#8212;&#8212;-+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+<br />
1 row in set (0.00 sec)</p>
<p>Hints?  </p>
<p>Best,</p>
<p>Jim</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baron Schwartz</title>
		<link>http://www.mysqlperformanceblog.com/2008/08/04/to-find-the-bottleneck-stop-guessing-and-start-measuring/comment-page-1/#comment-342011</link>
		<dc:creator>Baron Schwartz</dc:creator>
		<pubDate>Thu, 07 Aug 2008 18:59:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=415#comment-342011</guid>
		<description>Thanks Rock, that&#039;s a great war story and I love the sleep statement.  I agree with you, this performance consulting gig is hard work.  And like Joe says in the previous comment, it doesn&#039;t all fit into books either :-)</description>
		<content:encoded><![CDATA[<p>Thanks Rock, that&#8217;s a great war story and I love the sleep statement.  I agree with you, this performance consulting gig is hard work.  And like Joe says in the previous comment, it doesn&#8217;t all fit into books either <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rock Howard</title>
		<link>http://www.mysqlperformanceblog.com/2008/08/04/to-find-the-bottleneck-stop-guessing-and-start-measuring/comment-page-1/#comment-342003</link>
		<dc:creator>Rock Howard</dc:creator>
		<pubDate>Thu, 07 Aug 2008 18:43:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=415#comment-342003</guid>
		<description>Good article. In the late &#039;90s my company made a lot of money tuning deployment stacks running Java-based software systems. I led most of the efforts and while the typical solution involved tuning DB queries, that was not generally done to reduce the load on the DB server, but rather to reduce the CPU overhead of data translation on massive result sets. (The Oracle JDBC drivers were really bad in those days. I wonder if they ever fixed them.) I gave a presentation once on performance tuning Java-server based stacks and easily filled up 30 slides with all manner of possible bottlenecks. With all those considerations, the only possible approach, which I espoused relentlessly, was measure -- don&#039;t guess!

Another useful subpoint about the tuning process is this -- change one thing at a time. I had a client where two different teams were tuning simualtaneously. One was tuning the database and the other the application. As it turned out, those teams were tossing the bottleneck back and forth between them like a hot potato without even realizing it! Given the extreme panic within the organization, they might never have solved the issue without an outsider like myself stepping in and taking charge of the tuning process.

My favorite tuning challenge was a very tough nut where the key to dramatically improving throughput was inserting a strategically located sleep statement. The over-clogged network and database queue was spewing so many errors that the CPUs were spending most of their time churning through exceptions. The sleep statement forced everything to wait a bit and this dramatically reducing exception processing. From there I was able to tune the system to the point where the sleep was no longer necessary (but neither did it hurt so the customer decided to deploy with it in place just as a safety precaution.)

Well we made a lot of money and saved our clients millions of dollars, but I am very happy to be out of the performance tuning game. It is much harder work than most greenfield development. However I have recently soft lauched a new public site and I wouldn&#039;t mind at all if I was required to performance tune that site. At least I have a firm handle on the system design and that, in the long run, is the key to scalable performance.</description>
		<content:encoded><![CDATA[<p>Good article. In the late &#8217;90s my company made a lot of money tuning deployment stacks running Java-based software systems. I led most of the efforts and while the typical solution involved tuning DB queries, that was not generally done to reduce the load on the DB server, but rather to reduce the CPU overhead of data translation on massive result sets. (The Oracle JDBC drivers were really bad in those days. I wonder if they ever fixed them.) I gave a presentation once on performance tuning Java-server based stacks and easily filled up 30 slides with all manner of possible bottlenecks. With all those considerations, the only possible approach, which I espoused relentlessly, was measure &#8212; don&#8217;t guess!</p>
<p>Another useful subpoint about the tuning process is this &#8212; change one thing at a time. I had a client where two different teams were tuning simualtaneously. One was tuning the database and the other the application. As it turned out, those teams were tossing the bottleneck back and forth between them like a hot potato without even realizing it! Given the extreme panic within the organization, they might never have solved the issue without an outsider like myself stepping in and taking charge of the tuning process.</p>
<p>My favorite tuning challenge was a very tough nut where the key to dramatically improving throughput was inserting a strategically located sleep statement. The over-clogged network and database queue was spewing so many errors that the CPUs were spending most of their time churning through exceptions. The sleep statement forced everything to wait a bit and this dramatically reducing exception processing. From there I was able to tune the system to the point where the sleep was no longer necessary (but neither did it hurt so the customer decided to deploy with it in place just as a safety precaution.)</p>
<p>Well we made a lot of money and saved our clients millions of dollars, but I am very happy to be out of the performance tuning game. It is much harder work than most greenfield development. However I have recently soft lauched a new public site and I wouldn&#8217;t mind at all if I was required to performance tune that site. At least I have a firm handle on the system design and that, in the long run, is the key to scalable performance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Izenman</title>
		<link>http://www.mysqlperformanceblog.com/2008/08/04/to-find-the-bottleneck-stop-guessing-and-start-measuring/comment-page-1/#comment-340029</link>
		<dc:creator>Joe Izenman</dc:creator>
		<pubDate>Mon, 04 Aug 2008 16:25:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=415#comment-340029</guid>
		<description>Admittedly I haven&#039;t finished reading it yet, but I&#039;m going to hazard a guess and say that &quot;how to fix every performance problem&quot; probably doesn&#039;t quite fit into a book, either.</description>
		<content:encoded><![CDATA[<p>Admittedly I haven&#8217;t finished reading it yet, but I&#8217;m going to hazard a guess and say that &#8220;how to fix every performance problem&#8221; probably doesn&#8217;t quite fit into a book, either.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
