<?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>Xaprb &#187; Tools</title>
	<atom:link href="http://www.xaprb.com/blog/category/tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xaprb.com/blog</link>
	<description>Stay curious!</description>
	<lastBuildDate>Wed, 28 Jul 2010 17:40:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Aspersa&#8217;s mysql-summary tool</title>
		<link>http://www.xaprb.com/blog/2010/07/10/aspersas-mysql-summary-tool/</link>
		<comments>http://www.xaprb.com/blog/2010/07/10/aspersas-mysql-summary-tool/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 19:46:25 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Aspersa]]></category>
		<category><![CDATA[Maatkit]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1956</guid>
		<description><![CDATA[For those of you who miss what Maatkit&#8217;s mk-audit tool (now retired) gave you, there&#8217;s a pair of tools in Aspersa that more than replaces it.  I wrote previously about the summary tool.  I don&#8217;t think I have mentioned the mysql-summary tool.  It has been under development for a while, and at [...]


Related posts:<ol><li><a href='http://www.xaprb.com/blog/2010/05/16/apsersas-summary-tool-supports-adaptec-and-megaraid-controllers/' rel='bookmark' title='Permanent Link: Apsersa&#8217;s summary tool supports Adaptec and MegaRAID controllers'>Apsersa&#8217;s summary tool supports Adaptec and MegaRAID controllers</a></li><li><a href='http://www.xaprb.com/blog/2010/04/21/aspersa-a-new-opensource-toolkit/' rel='bookmark' title='Permanent Link: Aspersa, a new opensource toolkit'>Aspersa, a new opensource toolkit</a></li><li><a href='http://www.xaprb.com/blog/2010/05/07/using-aspersa-to-capture-diagnostic-data/' rel='bookmark' title='Permanent Link: Using Aspersa to capture diagnostic data'>Using Aspersa to capture diagnostic data</a></li><li><a href='http://www.xaprb.com/blog/2007/03/19/mysql-toolkits-show-grants-tool-091-released/' rel='bookmark' title='Permanent Link: MySQL Toolkit&#8217;s Show Grants tool 0.9.1 released'>MySQL Toolkit&#8217;s Show Grants tool 0.9.1 released</a></li><li><a href='http://www.xaprb.com/blog/2007/03/17/introducing-mysql-show-grants/' rel='bookmark' title='Permanent Link: Introducing MySQL Toolkit&#8217;s Show Grants tool'>Introducing MySQL Toolkit&#8217;s Show Grants tool</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>For those of you who miss what <a href="http://www.maatkit.org/">Maatkit</a>&#8217;s mk-audit tool (now retired) gave you, there&#8217;s a pair of tools in <a href="http://code.google.com/p/aspersa/">Aspersa</a> that more than replaces it.  <a href="http://www.xaprb.com/blog/2010/05/16/apsersas-summary-tool-supports-adaptec-and-megaraid-controllers/">I wrote previously about the summary tool</a>.  I don&#8217;t think I have mentioned the mysql-summary tool.  It has been under development for a while, and at this point it has quite a lot of functionality.  You can see a <a href="http://code.google.com/p/aspersa/wiki/mysql_summary">sample of the output on its wiki page</a>.</p>

<p>Related posts:<ol><li><a href='http://www.xaprb.com/blog/2010/05/16/apsersas-summary-tool-supports-adaptec-and-megaraid-controllers/' rel='bookmark' title='Permanent Link: Apsersa&#8217;s summary tool supports Adaptec and MegaRAID controllers'>Apsersa&#8217;s summary tool supports Adaptec and MegaRAID controllers</a></li><li><a href='http://www.xaprb.com/blog/2010/04/21/aspersa-a-new-opensource-toolkit/' rel='bookmark' title='Permanent Link: Aspersa, a new opensource toolkit'>Aspersa, a new opensource toolkit</a></li><li><a href='http://www.xaprb.com/blog/2010/05/07/using-aspersa-to-capture-diagnostic-data/' rel='bookmark' title='Permanent Link: Using Aspersa to capture diagnostic data'>Using Aspersa to capture diagnostic data</a></li><li><a href='http://www.xaprb.com/blog/2007/03/19/mysql-toolkits-show-grants-tool-091-released/' rel='bookmark' title='Permanent Link: MySQL Toolkit&#8217;s Show Grants tool 0.9.1 released'>MySQL Toolkit&#8217;s Show Grants tool 0.9.1 released</a></li><li><a href='http://www.xaprb.com/blog/2007/03/17/introducing-mysql-show-grants/' rel='bookmark' title='Permanent Link: Introducing MySQL Toolkit&#8217;s Show Grants tool'>Introducing MySQL Toolkit&#8217;s Show Grants tool</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/07/10/aspersas-mysql-summary-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How I keep track of notes</title>
		<link>http://www.xaprb.com/blog/2010/07/03/how-i-keep-track-of-notes/</link>
		<comments>http://www.xaprb.com/blog/2010/07/03/how-i-keep-track-of-notes/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 20:58:13 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[37Signals]]></category>
		<category><![CDATA[GTD]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1920</guid>
		<description><![CDATA[This is the follow-up to my post on how I keep track of tasks.  It&#8217;s important for me to have a good system for keeping notes and other files organized.  The problem usually turns out to be that I want them organized several different ways simultaneously: by date, by project, by person, by [...]


Related posts:<ol><li><a href='http://www.xaprb.com/blog/2010/06/30/how-i-keep-track-of-tasks/' rel='bookmark' title='Permanent Link: How I keep track of tasks'>How I keep track of tasks</a></li><li><a href='http://www.xaprb.com/blog/2006/07/23/how-to-track-what-owns-a-mysql-connection/' rel='bookmark' title='Permanent Link: How to track what owns a MySQL connection'>How to track what owns a MySQL connection</a></li><li><a href='http://www.xaprb.com/blog/2005/09/29/javascript-date-chooser/' rel='bookmark' title='Permanent Link: JavaScript date chooser'>JavaScript date chooser</a></li><li><a href='http://www.xaprb.com/blog/2005/11/17/maximizing-filesystem-portability/' rel='bookmark' title='Permanent Link: How to make file names cross-platform'>How to make file names cross-platform</a></li><li><a href='http://www.xaprb.com/blog/2006/08/02/what-to-do-when-innotop-crashes/' rel='bookmark' title='Permanent Link: What to do when innotop crashes'>What to do when innotop crashes</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>This is the follow-up to my post on <a href="http://www.xaprb.com/blog/2010/06/30/how-i-keep-track-of-tasks/">how I keep track of tasks</a>.  It&#8217;s important for me to have a good system for keeping notes and other files organized.  The problem usually turns out to be that I want them organized several different ways simultaneously: by date, by project, by person, by subject.  Alas, if I keep them in files on a hard drive, I can only choose one such organizing strategy, because filesystems are a single hierarchy.</p>

<p>I choose to organize by date, simply because most of the time I need access to notes and files about things I&#8217;m working on now or recently.  If I need to find files by project or subject, there&#8217;s a search feature in my file browser, and it works really well!  So date-organization is good enough for me.</p>

<p>Inside my home directory, I have a directory per year, and inside that, a directory per month.  If I write a note today, it goes into the $HOME/etc/2010/07/03/ directory.  The filename starts with today&#8217;s date.  That&#8217;s the simple organizing principle behind my note system.  It also lets me eventually move things off my computer into permanent storage, so I don&#8217;t have to keep backing things up forever and carrying around infinite amounts of data.  I keep the last couple of years; if I need access to notes or projects from 2006, I can go pull a hard drive off the shelf and pop it into my <a href="http://www.amazon.com/Vantec-NexStar-NST-D200SU-2-5-Inch-3-5-Inch/dp/B001QFNDXE/?tag=xaprb-20">hard drive dock</a> (buy one of those, and you&#8217;ll never get ripped off again by external drives with their own enclosures and power supplies).</p>

<p>I still need a quick way to create files and place them there, or move them there after I create them.  For creating files, I use Vim.  There is nothing better than a plain-text editor for me.  My Vim settings are such that if I begin a line with a hyphen, Vim keeps nice indentation for me, making it easy to take notes in bulleted lists with proper indentation.  If you&#8217;re on a call with me and you hear typing, I&#8217;m probably taking notes into Vim.</p>

<p>But it&#8217;s a pain to type out the full path to the file including the year, month, and date.  So I created some helper scripts and put them into my $PATH.  The most important are &#8216;t&#8217; and &#8216;c&#8217;.  &#8216;t&#8217; simply uses Vim to edit a file.  (It also creates any required directories, based on today&#8217;s date.)  So if I am on a call with Joe, I just type &#8216;t joe&#8217; into a terminal, and I&#8217;m editing /home/baron/etc/2010/07/03-joe.txt.</p>

<p>The &#8216;c&#8217; tool cats the file&#8217;s contents.  If I type &#8216;c joe&#8217;, it executes &#8216;cat /home/baron/etc/2010/07/03-joe.txt&#8217;.  This makes it easy to grep, copy and paste, and so on.</p>

<p>There are a few more tools: the &#8216;m&#8217; tool moves any file into the date-based hierarchy, so if I save a PDF of an order-confirmation page, for example, I can then &#8216;m&#8217; it and it goes into its proper place.  And I have a few tools to list files I created today, yesterday, this week, and this month.</p>

<p>I have a very important convention: when I&#8217;m taking notes and something becomes my responsibility to follow up on, I type TODO in the notes.  After the call ends, I can grep for TODO in the file and quickly transfer the item into the task system I described in the post linked from above.  This is how I can be confident that I&#8217;m not forgetting anything I&#8217;m supposed to do: I take notes and write it out as it happens, and then review the notes afterwards.</p>

<p>All told, this system kind of feels too simple to be a system.  Everyone else seems to use complicated online gizmos named after groceries, or whizbang apps created by 37Signals, but I&#8217;ve found none of them to meet my needs, and just went back to basics.  Basic is good.  Basic works.  Basic lets me concentrate on what I&#8217;m doing.</p>

<p>As I said in my previous post, part of this is based on the <a href="http://www.amazon.com/Getting-Things-Done-Stress-Free-Productivity/dp/0142000280?tag=xaprb-20">GTD</a> book, which I read through a couple of times (with a year in between) and picked the parts that made sense to me.  I think it&#8217;s a useful book to read, if you&#8217;re having trouble organizing yourself.  I would just caution against spending all your energy getting organized &#8212; leave a little energy for actually doing your work!</p>

<p>Related posts:<ol><li><a href='http://www.xaprb.com/blog/2010/06/30/how-i-keep-track-of-tasks/' rel='bookmark' title='Permanent Link: How I keep track of tasks'>How I keep track of tasks</a></li><li><a href='http://www.xaprb.com/blog/2006/07/23/how-to-track-what-owns-a-mysql-connection/' rel='bookmark' title='Permanent Link: How to track what owns a MySQL connection'>How to track what owns a MySQL connection</a></li><li><a href='http://www.xaprb.com/blog/2005/09/29/javascript-date-chooser/' rel='bookmark' title='Permanent Link: JavaScript date chooser'>JavaScript date chooser</a></li><li><a href='http://www.xaprb.com/blog/2005/11/17/maximizing-filesystem-portability/' rel='bookmark' title='Permanent Link: How to make file names cross-platform'>How to make file names cross-platform</a></li><li><a href='http://www.xaprb.com/blog/2006/08/02/what-to-do-when-innotop-crashes/' rel='bookmark' title='Permanent Link: What to do when innotop crashes'>What to do when innotop crashes</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/07/03/how-i-keep-track-of-notes/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Is Maatkit notable enough for Wikipedia now?</title>
		<link>http://www.xaprb.com/blog/2010/07/02/is-maatkit-notable-enough-for-wikipedia-now/</link>
		<comments>http://www.xaprb.com/blog/2010/07/02/is-maatkit-notable-enough-for-wikipedia-now/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 12:45:44 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Maatkit]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Wikipedia]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1910</guid>
		<description><![CDATA[The Maatkit article on Wikipedia was removed some time ago, after being deemed not notable.  I believe this is no longer the case.  It&#8217;s hard to find a credible book published on MySQL in the last few years that doesn&#8217;t mention Maatkit, there&#8217;s quite a bit of blogging about it from MySQL experts [...]


Related posts:<ol><li><a href='http://www.xaprb.com/blog/2009/01/13/where-do-you-use-maatkit-in-real-life/' rel='bookmark' title='Permanent Link: Where do you use Maatkit in real life?'>Where do you use Maatkit in real life?</a></li><li><a href='http://www.xaprb.com/blog/2008/05/21/get-maatkit-fast-command-line/' rel='bookmark' title='Permanent Link: Get Maatkit fast from the command line'>Get Maatkit fast from the command line</a></li><li><a href='http://www.xaprb.com/blog/2008/05/13/maatkit-in-rhel-and-centos/' rel='bookmark' title='Permanent Link: Maatkit in RHEL and CentOS'>Maatkit in RHEL and CentOS</a></li><li><a href='http://www.xaprb.com/blog/2007/11/18/new-maatkit-release-policy/' rel='bookmark' title='Permanent Link: New Maatkit release policy'>New Maatkit release policy</a></li><li><a href='http://www.xaprb.com/blog/2009/03/31/maatkit-version-3329-released/' rel='bookmark' title='Permanent Link: Maatkit version 3329 released'>Maatkit version 3329 released</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://en.wikipedia.org/w/index.php?title=Maatkit&#038;redirect=no">Maatkit article on Wikipedia</a> was removed some time ago, after being <a href="http://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Maatkit">deemed not notable</a>.  I believe this is no longer the case.  It&#8217;s hard to find a credible book published on MySQL in the last few years that doesn&#8217;t mention Maatkit, there&#8217;s quite a bit of blogging about it from MySQL experts and prominent community members, and the toolkit is certainly in wide use &#8212; it&#8217;s important enough that notable companies are supporting its development.  It&#8217;s available through every major Unix-like operating system&#8217;s package repository.  On Debian, it&#8217;s actually part of the mysql-client package, so if you install MySQL, you automatically get Maatkit too.  I believe it&#8217;s probably the second most important set of MySQL command-line tools; the most important, of course, is the set of client applications that is included with MySQL itself.</p>

<p>But my opinion on this topic is beside the point.  I&#8217;m the creator, and I&#8217;m biased.  The Maatkit Wikipedia article should be created by independent people, not the project&#8217;s founder.  If you think that Maatkit belongs on Wikipedia, I encourage you to help write that article.</p>

<p>Related posts:<ol><li><a href='http://www.xaprb.com/blog/2009/01/13/where-do-you-use-maatkit-in-real-life/' rel='bookmark' title='Permanent Link: Where do you use Maatkit in real life?'>Where do you use Maatkit in real life?</a></li><li><a href='http://www.xaprb.com/blog/2008/05/21/get-maatkit-fast-command-line/' rel='bookmark' title='Permanent Link: Get Maatkit fast from the command line'>Get Maatkit fast from the command line</a></li><li><a href='http://www.xaprb.com/blog/2008/05/13/maatkit-in-rhel-and-centos/' rel='bookmark' title='Permanent Link: Maatkit in RHEL and CentOS'>Maatkit in RHEL and CentOS</a></li><li><a href='http://www.xaprb.com/blog/2007/11/18/new-maatkit-release-policy/' rel='bookmark' title='Permanent Link: New Maatkit release policy'>New Maatkit release policy</a></li><li><a href='http://www.xaprb.com/blog/2009/03/31/maatkit-version-3329-released/' rel='bookmark' title='Permanent Link: Maatkit version 3329 released'>Maatkit version 3329 released</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/07/02/is-maatkit-notable-enough-for-wikipedia-now/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How I keep track of tasks</title>
		<link>http://www.xaprb.com/blog/2010/06/30/how-i-keep-track-of-tasks/</link>
		<comments>http://www.xaprb.com/blog/2010/06/30/how-i-keep-track-of-tasks/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 02:24:47 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1903</guid>
		<description><![CDATA[I use a super-simple system for keeping track of tasks that are mine personally to manage.  I use issue-tracking systems for software projects and consulting work, but there is still a bunch of work-related and personal work that I need to make sure I don&#8217;t forget.

The main point is not to ensure that I [...]


Related posts:<ol><li><a href='http://www.xaprb.com/blog/2010/07/03/how-i-keep-track-of-notes/' rel='bookmark' title='Permanent Link: How I keep track of notes'>How I keep track of notes</a></li><li><a href='http://www.xaprb.com/blog/2009/05/01/an-easy-way-to-run-many-tasks-in-parallel/' rel='bookmark' title='Permanent Link: An easy way to run many tasks in parallel'>An easy way to run many tasks in parallel</a></li><li><a href='http://www.xaprb.com/blog/2006/07/23/how-to-track-what-owns-a-mysql-connection/' rel='bookmark' title='Permanent Link: How to track what owns a MySQL connection'>How to track what owns a MySQL connection</a></li><li><a href='http://www.xaprb.com/blog/2007/10/07/high-performance-mysql-second-edition-query-performance-optimization/' rel='bookmark' title='Permanent Link: High Performance MySQL, Second Edition: Query Performance Optimization'>High Performance MySQL, Second Edition: Query Performance Optimization</a></li><li><a href='http://www.xaprb.com/blog/2009/07/01/how-to-add-a-wiki-homepage-sidebar-and-toc-in-google-code/' rel='bookmark' title='Permanent Link: How to add a wiki homepage, sidebar, and TOC in Google Code'>How to add a wiki homepage, sidebar, and TOC in Google Code</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I use a super-simple system for keeping track of tasks that are mine personally to manage.  I use issue-tracking systems for software projects and consulting work, but there is still a bunch of work-related and personal work that I need to make sure I don&#8217;t forget.</p>

<p>The main point is not to ensure that I don&#8217;t forget, actually.  It is to be able to put it out of my mind with confidence that I won&#8217;t lose it.  I have a crowded mind, and the cleaner I can keep it, the better.</p>

<p>My system has three parts: my pockets, my notepad, and a directory on my computer.</p>

<p>In my front pocket I have a ballpoint pen.  Currently it says Holiday Inn on the side.  In my back pocket, I have a small piece of paper &#8212; usually about half the size of a standard letter paper, folded small enough to fit.  It might be a used envelope, or a napkin, or a piece of actual notebook paper.  I write down everything that matters to me.  If I hear a song on the radio and I think my wife will like it, I write down some key lyrics I can search later, such as &#8220;your arms are my castle, your heart is my sky.&#8221;  I write down anything I feel guilty about not doing, or neat ideas about stuff I could do, or whatever occurs to me.  The goal is to write it down and trust that it&#8217;s now permanently in the system, then clear my head.</p>

<p>I do much the same thing with my notebook.  I tend to pick these things up at conferences.  I use two or three pages a week.  A small size, like the size of a paperback book, is best.  Legal pads are too big.  One of the best pads I ever got was an InnoDB pad.  I keep one page for random whatever-comes-to-me.  At the beginning of each week, I collate these items; some of them I move off to the directory on my computer, others go into a single page, grouped by importance or topic as I see fit, in the notebook.  The page needs to fit everything I&#8217;ll do that week.  There&#8217;s no way I can do more than a page&#8217;s worth of things in a week.  Typically about half the page is carried over to next week.  (I just cross things off as I complete them or move them to the clean page.)  This ensures that all of the important and/or urgent things are easy for me to reference, without a bunch of other stuff intruding.  I also write down things I do that aren&#8217;t in my list &#8212; if I jump in and help out on a project, for example, I&#8217;ll write that down and then cross it off.  This is a good record for my weekly report.</p>

<p>I just came back from a conference, so there are pages and pages of thoughts stimulated from conversations, people to follow up with, thank-you notes to send, and so on.  A lot of this is going to be easy to take care of: I&#8217;ll just do it if it takes only a second, or move it to my computer for later followup.  After I collate and organize, I tear out the old pages, feed them into my weekly report, and throw them away.  They are redundant.</p>

<p>In my computer&#8217;s home directory, I have a directory to hold text files.  Here I hold medium-term and long-term items, things that I want to do &#8220;someday&#8221; or reference material, project notes, and so on.  I name each text file by topic, and there are dozens.  I keep these as simple and few as possible.  There&#8217;s one for music, for example.  I looked up those lyrics, and then put the artist and album into todo-music.txt in my directory.  Next time I decide to order a batch of CDs, I&#8217;ll refer to this list.  The names of the files aren&#8217;t scientific &#8212; I just started out with what seemed right, and changed as I saw the need to; the current files have served well for a long time, so I think it&#8217;s stable and useful.  I organize the lists in two sections: the top N priority items, and everything else.  They are separated by a blank line.  There is no need to be fancier, I find.  Most things go into the everything-else category.</p>

<p>So in the end, my pockets and one page in the notebook are for capturing ideas as they come to me, another page is for what I decided to prioritize for the week, and the computer is the long-term spillover for things that need to get out of the notebook.  This is a lot like levels of cache in a computer.  I&#8217;m keeping the most important stuff in a compact way, easy to work with.  And paper is definitely easier to work with than anything with an ON switch.  I have no categories, sorting, tagging, hierarchies, or anything else like that.  If it&#8217;s a single page the size of my hand, there&#8217;s no need.</p>

<p>This system was inspired by multiple attempts to use task lists on computers, personal organizers, the Getting Things Done system, the Seven Habits of Highly Effective People method, and many more.  Name your favorite app or method &#8212; I&#8217;ve probably tried it or something like it.  These days it&#8217;s pen, paper, and Vim.  The system has been working for me for a couple of years with excellent results; I rarely to never forget anything.  Although I may deprioritize it, which is effectively the same as saying I&#8217;ll never do it, I have the peace of mind that comes from knowing I have ten years or so of ideas I&#8217;ll never forget, should I ever find myself with ten years to spare and nothing to do with them.</p>

<p>The Getting Things Done system is very valuable in one specific way for me: capture <em>everything</em> and get it out of the head, to keep the head clear.  I can&#8217;t overstate how important that is to me.</p>

<p>Next I&#8217;ll write about how I get things into the system in a way that lets me also have confidence I&#8217;m not losing track of something I&#8217;m taking on (or being asked to do).</p>

<p>Related posts:<ol><li><a href='http://www.xaprb.com/blog/2010/07/03/how-i-keep-track-of-notes/' rel='bookmark' title='Permanent Link: How I keep track of notes'>How I keep track of notes</a></li><li><a href='http://www.xaprb.com/blog/2009/05/01/an-easy-way-to-run-many-tasks-in-parallel/' rel='bookmark' title='Permanent Link: An easy way to run many tasks in parallel'>An easy way to run many tasks in parallel</a></li><li><a href='http://www.xaprb.com/blog/2006/07/23/how-to-track-what-owns-a-mysql-connection/' rel='bookmark' title='Permanent Link: How to track what owns a MySQL connection'>How to track what owns a MySQL connection</a></li><li><a href='http://www.xaprb.com/blog/2007/10/07/high-performance-mysql-second-edition-query-performance-optimization/' rel='bookmark' title='Permanent Link: High Performance MySQL, Second Edition: Query Performance Optimization'>High Performance MySQL, Second Edition: Query Performance Optimization</a></li><li><a href='http://www.xaprb.com/blog/2009/07/01/how-to-add-a-wiki-homepage-sidebar-and-toc-in-google-code/' rel='bookmark' title='Permanent Link: How to add a wiki homepage, sidebar, and TOC in Google Code'>How to add a wiki homepage, sidebar, and TOC in Google Code</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/06/30/how-i-keep-track-of-tasks/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Reacting to small variations in response time</title>
		<link>http://www.xaprb.com/blog/2010/05/26/reacting-to-small-variations-in-response-time/</link>
		<comments>http://www.xaprb.com/blog/2010/05/26/reacting-to-small-variations-in-response-time/#comments</comments>
		<pubDate>Thu, 27 May 2010 01:34:24 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Aspersa]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[New Relic]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1879</guid>
		<description><![CDATA[I wrote recently about early detection for MySQL performance problems.  If your server is having micro-fluctuations in performance, it&#8217;s important to know, because very soon they will turn much worse.  What can you do about this?

The most important thing is not to guess at what&#8217;s happening, but to measure instead.  I have [...]


Related posts:<ol><li><a href='http://www.xaprb.com/blog/2009/12/09/response-time-optimization-in-systems-that-are-queued/' rel='bookmark' title='Permanent Link: Response-time optimization in systems that are queued'>Response-time optimization in systems that are queued</a></li><li><a href='http://www.xaprb.com/blog/2006/01/14/browser-variations-in-regexpexec/' rel='bookmark' title='Permanent Link: Browser variations in RegExp.exec()'>Browser variations in RegExp.exec()</a></li><li><a href='http://www.xaprb.com/blog/2008/11/26/a-metric-for-mysql-load-average/' rel='bookmark' title='Permanent Link: A metric for MySQL load average'>A metric for MySQL load average</a></li><li><a href='http://www.xaprb.com/blog/2009/08/18/how-to-find-un-indexed-queries-in-mysql-without-using-the-log/' rel='bookmark' title='Permanent Link: How to find un-indexed queries in MySQL, without using the log'>How to find un-indexed queries in MySQL, without using the log</a></li><li><a href='http://www.xaprb.com/blog/2009/11/14/mk-query-digest-now-understands-http/' rel='bookmark' title='Permanent Link: mk-query-digest now understands HTTP'>mk-query-digest now understands HTTP</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I wrote recently about <a href="http://www.mysqlperformanceblog.com/2010/05/18/is-your-servers-performance-about-to-degrade/">early detection for MySQL performance problems</a>.  If your server is having micro-fluctuations in performance, it&#8217;s important to know, because very soon they will turn much worse.  What can you do about this?</p>

<p>The most important thing is not to guess at what&#8217;s happening, but to measure instead.  I have seen these problems from DNS, the binary log, failing hardware, the query cache, the table cache, the thread cache, and a variety of InnoDB edge cases.  Guessing at the problem is very dangerous; you need diagnostic data.  But it is often quite hard to catch a problem in action when you can only observe it in hindsight, and it happens only for a few seconds once or twice a week.  This blog post is about how to detect small variations in performance, especially when it is most difficult to observe them.</p>

<p>Sometimes it&#8217;s actually quite easy, so let&#8217;s look at the easy cases first.  Over time I have built up a collection of tricks and <a href="http://code.google.com/p/aspersa/">tools</a> for catching a problem in action.  The process of catching and diagnosing a lightning-fast performance problem looks like the following:</p>

<ol>
<li>Determine the symptoms of the problem.</li>
<li>Determine how to observe the symptoms reliably and quickly.</li>
<li>Determine how to gather diagnostic data for later.</li>
<li>Set up tools or processes to do the above.</li>
<li>Sift the collected data and diagnose.</li>
</ol>

<p>This is 95% about figuring out how to observe the problem and gathering the data, and 5% about actually diagnosing.  If you don&#8217;t get the 95% right, you&#8217;ll gather too little or too much data, or you&#8217;ll capture it at the wrong time.  Your job is hard enough; you won&#8217;t be successful if you simply gather gigs of data for weeks at a time.  You need to be as precise as you can.  Here are some examples:</p>

<ol>
<li>There are normally very few connections to the server, but sometimes I start getting &#8220;Error: max_connections exceeded&#8221; or similar.  <em>Solution: observe Threads_connected from SHOW GLOBAL STATUS and react when it grows too large, or when you cannot log in to query Threads_connected.</em></li>
<li>There are normally very few queries running, but we have a connection pool (and thus Threads_connected is constant).  During the freezes, hundreds of queries show up in SHOW PROCESSLIST.  <em>Solution: observe Threads_running from SHOW GLOBAL STATUS and react when it grows too large.</em></li>
</ol>

<p>You get the point.  Find a simple metric and figure out how to capture it &#8212; usually this is possible with a little bit of bash, awk, and grep.  You might need to look for something specific in SHOW INNODB STATUS, for example, such as a large number of transactions in LOCK WAIT status.</p>

<p>But sometimes it&#8217;s much harder.  What if you simply can&#8217;t observe the problem internally to MySQL?  This does happen, especially when nothing changes except for response time.  This was the case in the customer&#8217;s system that I discussed in the &#8220;predicting performance problems&#8221; blog post linked above.  Every single metric provided by MySQL itself stayed constant during the mini-freezes.  The problem is that you can&#8217;t get information on response time from within MySQL.</p>

<p>I ended up writing tools to help with this, of course.  I&#8217;ll show the results below.</p>

<p>If fluctuations in response time are the problem, then the way to observe it is to measure response time.  This requires some care, because you don&#8217;t want false positives, and a lot of my ideas were obviously vulnerable to false positives.  I could cross them off right away.  I can&#8217;t trigger on unusually large or small numbers of queries, for example, because those just happen as the workload fluctuates through the day, and random user behavior naturally introduces variations too.</p>

<p>I ended up writing a tool to tail the slow query log file, which I set to zero so it captured all queries with microsecond precision.  Once per second, MySQL writes out the current timestamp to the log file, so when I see that marker, I know that a second&#8217;s worth of queries has passed by.  I aggregate the last second&#8217;s worth of queries (count, total time, average time) and print out a line.</p>

<p>This in itself does not provide a good way to know when something unusual is happening, but it gives the foundation for it.  I took it slightly further: I kept a sliding window of the last 60 1-second averages, and took the standard deviation of those.  If the current second&#8217;s average response time deviates significantly from the average response time over the last 60 seconds, then something is wrong.  &#8220;Significant&#8221; is pretty easy to measure with standard deviations, so that&#8217;s where the real magic comes in.  Let&#8217;s see some samples of this.</p>

<p>First, here&#8217;s a bit of the slow query log chopped into 1-second segments and aggregated:</p>

<code><pre>
           Time        Total  Count          Avg    1-Min Avg  1-Min StDev        Sigma
100519 18:05:17     0.477078   2084     0.000229     0.000795     0.063251     0.008954
100519 18:05:18     0.264729   1823     0.000145     0.000756     0.061334     0.009960
100519 18:05:19     0.287641   1936     0.000149     0.000720     0.059481     0.009599
100519 18:05:20     0.213181   1619     0.000132     0.000691     0.058050     0.009641
100519 18:05:21     0.276063   1520     0.000182     0.000669     0.056806     0.008587
100519 18:05:22     0.289921   1963     0.000148     0.000642     0.055310     0.008936
100519 18:05:23     0.277754   1882     0.000148     0.000618     0.053983     0.008717
100519 18:05:24     0.337821   1900     0.000178     0.000598     0.052745     0.007963
100519 18:05:25     0.236592   1727     0.000137     0.000579     0.051682     0.008556
100519 18:05:26     0.257150   1488     0.000173     0.000566     0.050821     0.007727
100519 18:05:27     0.303697   1672     0.000182     0.000552     0.049908     0.007412
100519 18:05:28     0.182106   1416     0.000129     0.000539     0.049163     0.008346
100519 18:05:29     0.211202   1631     0.000129     0.000525     0.048347     0.008186
</pre></code>

<p>The columns mean the following:</p>

<ul>
<li>Time is the timestamp of this second&#8217;s stats.</li>
<li>Total is the total response time within the sample, in seconds.</li>
<li>Count is how many queries were in that sample.</li>
<li>Avg is just the mean response time (Total / Count).</li>
<li>1-Min Avg is the one-minute moving average of response time.</li>
<li>1-Min StDev is the standard deviation of the average response times for each of the previous 60 seconds.</li>
<li>Sigma is the difference between this second&#8217;s average response time and the 1-Min Avg, in standard deviations.</li>
</ul>

<p>As you can see, most of the time the deviation between this second&#8217;s average and the last minute&#8217;s average is quite low.  But when there&#8217;s a meaningful fluctuation in performance, that changes pretty clearly.  Here&#8217;s a sample with a blip at 18:09:30:</p>

<code><pre>
           Time        Total  Count          Avg    1-Min Avg  1-Min StDev        Sigma
100519 18:09:26     0.187038   1245     0.000150     0.000159     0.006844     0.001343
100519 18:09:27     0.269272   1697     0.000159     0.000160     0.006862     0.000178
100519 18:09:28     0.329386   1901     0.000173     0.000160     0.006895     0.001865
100519 18:09:29     0.350918   2017     0.000174     0.000161     0.006929     0.001881
100519 18:09:30     0.016610     73     0.000228     0.000161     0.006943     0.009537
100519 18:09:31     0.590175   2905     0.000203     0.000162     0.007074     0.005815
100519 18:09:32     0.384193   1879     0.000204     0.000163     0.007133     0.005783
100519 18:09:33     0.345033   2044     0.000169     0.000163     0.007133     0.000815
100519 18:09:34     0.289663   1793     0.000162     0.000163     0.007148     0.000255
</pre></code>

<p>That was a fast one!  It flew by too quickly to do much about.  But it was also not a very large deviation, and could have been a false positive.  In any case, I highly doubt that we would have caught anything meaningful by triggering a stats-collection process just then.  Let&#8217;s keep looking.</p>

<code><pre>
           Time        Total  Count          Avg    1-Min Avg  1-Min StDev        Sigma
100519 18:10:05     0.209619   1578     0.000133     0.000181     0.009542     0.005044
100519 18:10:06     0.279070   1849     0.000151     0.000181     0.009546     0.003167
100519 18:10:07     1.152811   1624     0.000710     0.000189     0.010152     0.051257
100519 18:10:08     0.342763   1450     0.000236     0.000191     0.010188     0.004478
100519 18:10:09     0.200373   1452     0.000138     0.000190     0.010182     0.005155
100519 18:10:10     0.231888   1577     0.000147     0.000191     0.010190     0.004289
100519 18:10:13     0.000459     10     0.000046     0.000191     0.010241     0.014203
100519 18:10:14     0.001999      4     0.000500     0.000189     0.010139     0.030678
100519 18:10:15     0.165705    582     0.000285     0.000189     0.010151     0.009423
100519 18:10:16     7.129640   5104     0.001397     0.000251     0.024463     0.046854
100519 18:10:17     1.140011   2859     0.000399     0.000256     0.024555     0.005817
100519 18:10:18     0.325617   2240     0.000145     0.000255     0.024491     0.004460
100519 18:10:19     0.243101   1538     0.000158     0.000255     0.024510     0.003966
</pre></code>

<p>Another relatively short blip but a bit longer.  The mean response time really didn&#8217;t deviate as much as my client was complaining about &#8212; they were showing me New Relic transaction traces with 50-second waits.  Maybe I could have caught something here, but I doubt that it&#8217;d be enough to separate the signal from the noise.  Still, at this point you can clearly see how sensitive this technique is.  The deviation in average response varies from a few thousandths of a sigma to a few hundredths.  Let&#8217;s keep looking for something more dramatic to use as a trigger:</p>

<code><pre>
           Time        Total  Count          Avg    1-Min Avg  1-Min StDev        Sigma
100519 18:10:57     0.352336   2038     0.000173     0.000282     0.026701     0.004092
100519 18:10:58     0.260373   1692     0.000154     0.000283     0.026725     0.004817
100519 18:10:59     1.453306   1834     0.000792     0.000294     0.027073     0.018400
100519 18:11:00     0.264517   1658     0.000160     0.000295     0.027084     0.004989
100519 18:11:01     0.093991    953     0.000099     0.000294     0.027148     0.007203
100519 18:11:02     1.119373    469     0.002387     0.000306     0.027513     0.075629
100519 18:11:03     8.609779    291     0.029587     0.000395     0.038954     0.749383
100519 18:11:04     3.474422    103     0.033732     0.000435     0.040854     0.815026
100519 18:11:05     4.095386    111     0.036895     0.000483     0.043286     0.841211
100519 18:11:06    14.951602    131     0.114134     0.000647     0.065451     1.733932
100519 18:11:07     5.954177     52     0.114503     0.000720     0.068831     1.653074
100519 18:11:08    19.979373     53     0.376969     0.000952     0.096110     3.912385
100519 18:11:09     8.056343     16     0.503521     0.001047     0.100590     4.995285
100519 18:11:10    28.035963      7     4.005138     0.001380     0.138789    28.847777
100519 18:11:11     0.017634     69     0.000256     0.001400     0.139897     0.008182
100519 18:11:12    10.516826     20     0.525841     0.001548     0.145732     3.597660
100519 18:11:13    11.889159     50     0.237783     0.001687     0.151319     1.560253
100519 18:11:14     0.032239    138     0.000234     0.001685     0.151199     0.009599
100519 18:11:15    39.607576     38     1.042305     0.002164     0.204041     5.097713
100519 18:11:16    14.577523     40     0.364438     0.002397     0.215261     1.681870
100519 18:11:17    47.602524     34     1.400074     0.003094     0.278776     5.011118
100519 18:11:18     0.016022     84     0.000191     0.003180     0.282795     0.010570
</pre></code>

<p>We totally hit pay dirt here.  This period in the log corresponded exactly to one of the visible spikes in New Relic.  There were extremely long queries in the log, and throughput dropped to the floor &#8212; for an extended time.  In the far right-hand column, Sigma is in the double digits.  More experience showed me that on this particular client&#8217;s workload, anything above 0.3 Sigma is a reliable indicator of a real performance problem.  If that condition becomes true, then it&#8217;s time to gather diagnostic data for a while.  This is resistant to false positives from things like the occasional one-off long-running query.</p>

<p>After building this tool &#8212; maybe 30 minutes of work or so &#8212; I can see that I could have used other metrics instead.  The number of queries per second (throughput) varies, just as response time does.  And I probably could go back to the database and start watching Handler_ counters, or similar things like Innodb_rows_read, with the same technique.  I wasn&#8217;t able to see those things as possibilities because of the overwhelming amount of information to sift through before (and I still don&#8217;t really know that they&#8217;re going to show spikes and notches the same way, I&#8217;m just speculating; they might be really noisy and unreliable).  However, focusing on response time is an accurate metric, because response time is what actually matters.  Handler counters and rows-read counters are secondary effects that can lie, and there is never anything wrong with focusing on primary sources.  Looking at secondary things is far too likely to present you with unreliable information, and you end up on wild goose chases that consume huge amounts of your client&#8217;s time.</p>

<p>The tool I wrote for this task is crude, and not formally tested, but it&#8217;s a great proof of concept.  I think the next step is probably going to be something like revamping mk-loadavg (and probably renaming it!) to be able to capture load metrics and variations in a more flexible and meaningful way.</p>

<p>The end result on this case is at least two problems, by the way (we&#8217;re still working on it).  One was <a href="http://www.mysqlperformanceblog.com/2008/05/31/dns-achilles-heel-mysql-installation/">DNS flakiness</a>.  The server was not configured with skip_name_resolve, and when DNS stopped working for a short period, everything stopped working.  After clearing that up, many but not all of the spikes in response time went away, and permitted me to see that InnoDB is also having trouble.  It is actually quite common for multiple things to be going badly on a server, which makes a disciplined approach all the more important.  Trial and error is a disaster in cases like these.  Peter and I wrote a brief <a href="http://www.percona.com/about-us/white-papers">whitepaper</a> about our approach, by the way.  You might find it helpful if you are also facing complex performance problems.</p>

<p>Related posts:<ol><li><a href='http://www.xaprb.com/blog/2009/12/09/response-time-optimization-in-systems-that-are-queued/' rel='bookmark' title='Permanent Link: Response-time optimization in systems that are queued'>Response-time optimization in systems that are queued</a></li><li><a href='http://www.xaprb.com/blog/2006/01/14/browser-variations-in-regexpexec/' rel='bookmark' title='Permanent Link: Browser variations in RegExp.exec()'>Browser variations in RegExp.exec()</a></li><li><a href='http://www.xaprb.com/blog/2008/11/26/a-metric-for-mysql-load-average/' rel='bookmark' title='Permanent Link: A metric for MySQL load average'>A metric for MySQL load average</a></li><li><a href='http://www.xaprb.com/blog/2009/08/18/how-to-find-un-indexed-queries-in-mysql-without-using-the-log/' rel='bookmark' title='Permanent Link: How to find un-indexed queries in MySQL, without using the log'>How to find un-indexed queries in MySQL, without using the log</a></li><li><a href='http://www.xaprb.com/blog/2009/11/14/mk-query-digest-now-understands-http/' rel='bookmark' title='Permanent Link: mk-query-digest now understands HTTP'>mk-query-digest now understands HTTP</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/05/26/reacting-to-small-variations-in-response-time/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
