<?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>domas mituzas &#187; contention</title>
	<atom:link href="http://mituzas.lt/tag/contention/feed/" rel="self" type="application/rss+xml" />
	<link>http://mituzas.lt</link>
	<description></description>
	<lastBuildDate>Fri, 30 Jul 2010 07:36:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>Poor man&#8217;s contention profiling</title>
		<link>http://mituzas.lt/2009/02/15/poor-mans-contention-profiling/</link>
		<comments>http://mituzas.lt/2009/02/15/poor-mans-contention-profiling/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 12:55:50 +0000</pubDate>
		<dc:creator>Domas Mituzas</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[contention]]></category>
		<category><![CDATA[gdb]]></category>
		<category><![CDATA[profiling]]></category>

		<guid isPermaLink="false">http://dammit.lt/?p=378</guid>
		<description><![CDATA[I wrote already about poor man&#8217;s query profiling techniques last summer. Today I&#8217;m going to share poor man&#8217;s contention profiling tool, for all these poor souls which do not have Solaris with dtrace or pstack, don&#8217;t want to run tcmalloc &#8230; <a href="http://mituzas.lt/2009/02/15/poor-mans-contention-profiling/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I wrote already about <a href='http://dammit.lt/2008/05/22/poor-mans-query-profiling/'>poor man&#8217;s query profiling</a> techniques last summer. Today I&#8217;m going to share poor man&#8217;s contention profiling tool, for all these poor souls which do not have Solaris with dtrace or pstack, don&#8217;t want to run tcmalloc contention profiler, and simply need some easy hack to see &#8216;what the heck is going on in my server&#8217;. Here it is:</p>
<pre>
gdb \
    -ex "set pagination 0" \
    -ex "thread apply all bt" \
    --batch -p $(pidof mysqld)
</pre>
<p>Run few times, and you will have enough samples to start judging. Do note, this may stop the process execution for a second, so do not spam it in too tight loop.<br />
Once you have results it is just a matter of 20-liner script to extract any useful calculations :) </p>
<p>P.S. I&#8217;d love to see efficient pstack implementation for 64-bit Linux :) </p>
<p><b>update:</b> this now lives at <a href='http://poormansprofiler.org'>http://poormansprofiler.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mituzas.lt/2009/02/15/poor-mans-contention-profiling/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
