<?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>Totally Nerdy Information</title>
	<atom:link href="http://blog.toadhead.net/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.toadhead.net</link>
	<description>Mike Heath&#039;s Blog</description>
	<lastBuildDate>Tue, 15 Mar 2011 03:39:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Virtual Box Notification Applet</title>
		<link>http://blog.toadhead.net/index.php/2011/03/10/virtual-box-notification-applet/</link>
		<comments>http://blog.toadhead.net/index.php/2011/03/10/virtual-box-notification-applet/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 02:22:37 +0000</pubDate>
		<dc:creator>Mike Heath</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.toadhead.net/?p=90</guid>
		<description><![CDATA[One of the really powerful features of Virtual Box is that it lets you start VMs in a headless mode. You can connect to the VMs using RDP or just let them run in the background and do their job. The problem with running a lot of VMs in headless mode is trying to determine [...]]]></description>
			<content:encoded><![CDATA[<p>One of the really powerful features of Virtual Box is that it lets you start VMs in a headless mode. You can connect to the VMs using RDP or just let them run in the background and do their job. The problem with running a lot of VMs in headless mode is trying to determine which VMs are running and when I want to shutdown the VM, I have to go to the command line and do a <code>VBoxManage controlvm VM_NAME acpipowerbutton</code>. This can get really tedious.</p>
<p>To simplify the most common interactions I do with my VMs, I built a simple Notification Area applet in Python. I started with this great tutorial that I found after doing some Google searches, <a href="http://mteixeira.wordpress.com/2009/04/18/gnome-notification-area-application-in-python-english/">Gnome Notification Area Application in Python</a>. This is a great starting point for building applets for the Notification Area.</p>
<p>When I right click on my notification applet, I want it to bring up a popup menu with all of my VMs. I wrote the following Python function to list VirtualBox VMs:</p>
<pre>def listVMs(type):
  f = os.popen('VBoxManage list ' + type)
  lines = f.readlines()
  vms = []
  for line in lines:
    vms.append(line[1:line.rfind('"')])
  f.close()
  return vms</pre>
<p><code>VBoxManage list</code> can list all kinds of interesting things in VirtualBox but I only care about <code>vms</code> to list all the VMs and <code>runningvms</code> to list all the running VMs. I then use these lists to populate the popup menu with options for shutting down running VMs and options for starting non-running VMs in normal mode or in headless mode.</p>
<p>When I click on my icon in the Notification Area, I want it to either start the VirtualBox Manager or focus the VirtualBox Manager window if it is already running. Starting the VirtualBox Manager is easy. Determining if the VirtualBox Manager is already running and focusing its window is much more difficult. I found <code>wmctrl</code> which allows me to focus windows based on their title and I&#8217;m able to leverage this in my applet.</p>
<p>The script I&#8217;m using in its entirety is available at <a href='http://blog.toadhead.net/wp-content/uploads/vbox-notification-app.py_.txt'>vbox-notification-app.py</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toadhead.net/index.php/2011/03/10/virtual-box-notification-applet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>USB 3.0 Module XHCI Breaks Suspend on Linux</title>
		<link>http://blog.toadhead.net/index.php/2011/02/17/usb-3-0-module-xhci-breaks-suspend-on-linux/</link>
		<comments>http://blog.toadhead.net/index.php/2011/02/17/usb-3-0-module-xhci-breaks-suspend-on-linux/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 02:05:11 +0000</pubDate>
		<dc:creator>Mike Heath</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.toadhead.net/?p=85</guid>
		<description><![CDATA[I just got a brand new Lenovo ThinkPad W510 for work.  It&#8217;s a great machine.  Really fast.  Unfortunately, it hasn&#8217;t been suspending for me in Linux.  It starts to suspend and then fails.  It turns on the Linux module, XHCI, used for USB 3 is broken. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/522998 https://bugzilla.redhat.com/show_bug.cgi?id=623573 To remedy the problem, I just did: [...]]]></description>
			<content:encoded><![CDATA[<p>I just got a brand new Lenovo ThinkPad W510 for work.  It&#8217;s a great machine.  Really fast.  Unfortunately, it hasn&#8217;t been suspending for me in Linux.  It starts to suspend and then fails.  It turns on the Linux module, XHCI, used for USB 3 is broken.</p>
<p><a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/522998">https://bugs.launchpad.net/ubuntu/+source/linux/+bug/522998</a></p>
<p><a href="https://bugzilla.redhat.com/show_bug.cgi?id=623573">https://bugzilla.redhat.com/show_bug.cgi?id=623573</a></p>
<p>To remedy the problem, I just did:</p>
<pre>sudo rmmod xhci_hcd</pre>
<p>Fortunately, I don&#8217;t have any USB 3 devices.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toadhead.net/index.php/2011/02/17/usb-3-0-module-xhci-breaks-suspend-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CPU/Thread Affinity in Java</title>
		<link>http://blog.toadhead.net/index.php/2011/01/22/cputhread-affinity-in-java/</link>
		<comments>http://blog.toadhead.net/index.php/2011/01/22/cputhread-affinity-in-java/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 06:38:24 +0000</pubDate>
		<dc:creator>Mike Heath</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Netty]]></category>

		<guid isPermaLink="false">http://blog.toadhead.net/?p=81</guid>
		<description><![CDATA[I&#8217;ve been reading about Receive Packet Steering on Linux. I have heard anecdotal evidence that this can greatly improve performance. It made me wonder if you could improve performance even more by telling the kernel that you want the thread the processes the IO for a particular interface to run on the same CPU that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been reading about <a href="http://moblog.wiredwings.com/archives/20100827/Howto-Enable-Receive-Packet-Steering-RPS-on-Linux-2.6.35.html">Receive Packet Steering on Linux</a>.  I have heard anecdotal evidence that this can greatly improve performance.  It made me wonder if you could improve performance even more by telling the kernel that you want the thread the processes the IO for a particular interface to run on the same CPU that is handling the interrupts for the interface.</p>
<p>Java doesn&#8217;t provide support for CPU/Thread affinity out of the box.  Linux has the <a href="http://linux.die.net/man/2/sched_setaffinity">sched_setaffinity(2)</a> that does this.  So, I wrote some JNI code to allow me to set a thread&#8217;s affinity mask for a particular CPU.  I&#8217;ve pushed this code out to <a href="https://github.com/mheath/cpu">GitHub</a>.  I also implemented a CpuLocal class that is similar to ThreadLocal.  The build is targeted for 64-bit platforms and may require some tweaking to get it to run on yoru environment.</p>
<p>Unfortunately, I haven&#8217;t had much time (or proper resources) to benchmark my theories about combining CPU/thread affinity with receive packet steering but I thought I would push the code out anyway so that others can start playing with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toadhead.net/index.php/2011/01/22/cputhread-affinity-in-java/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Web Socket protocol support in Java using JBoss Netty</title>
		<link>http://blog.toadhead.net/index.php/2009/12/19/web-socket-protocol-support-in-java-using-jboss-netty/</link>
		<comments>http://blog.toadhead.net/index.php/2009/12/19/web-socket-protocol-support-in-java-using-jboss-netty/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 21:01:07 +0000</pubDate>
		<dc:creator>Mike Heath</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Netty]]></category>

		<guid isPermaLink="false">http://swamp.homelinux.net/blog/?p=78</guid>
		<description><![CDATA[I&#8217;ve been playing with Web Sockets using Google&#8217;s Chrome browser. Web Sockets, put simply, is a really nice way for a web application to talk to a remote server and allows the remote server to talk back. There are currently various ways of doing this with using Comet. But let&#8217;s be honest. Comet is a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing with Web Sockets using Google&#8217;s Chrome browser.  Web Sockets, put simply, is a really nice way for a web application to talk to a remote server and allows the remote server to talk back.  There are currently various ways of doing this with using <a href="http://en.wikipedia.org/wiki/Comet_(programming)">Comet</a>.  But let&#8217;s be honest.  Comet is a total hack.  Web Sockets, on the other hand, is a very elegant solution.</p>
<p>I submitted <a href="https://jira.jboss.org/jira/browse/NETTY-264">a patch</a> to the Netty project for supporting the <a href="http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-66">Web Sockets protocol</a>.</p>
<p>To demonstrate how to use this patch, I&#8217;ve created a little demo.  This demo consists of a simple web page for sending data to the server using the <a href="http://dev.w3.org/html5/websockets/">Web Sockets API</a> JavaScript API, and a simple Netty server for serving up the web page and handling the data send over the Web Socket protocol.  You can download this demo from, <a href="http://people.apache.org/~mheath/websocketexample.zip">http://people.apache.org/~mheath/websocketexample.zip</a>.  To compile it, you will need that latest version of Netty from Subversion and apply the patch I mentioned earlier.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toadhead.net/index.php/2009/12/19/web-socket-protocol-support-in-java-using-jboss-netty/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Performance comparison of Apache MINA and JBoss Netty Revisited</title>
		<link>http://blog.toadhead.net/index.php/2009/11/25/performance-comparison-of-apache-mina-and-jboss-netty-revisited/</link>
		<comments>http://blog.toadhead.net/index.php/2009/11/25/performance-comparison-of-apache-mina-and-jboss-netty-revisited/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 01:19:42 +0000</pubDate>
		<dc:creator>Mike Heath</dc:creator>
				<category><![CDATA[ADBCJ]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[MINA]]></category>
		<category><![CDATA[Netty]]></category>
		<category><![CDATA[Thesis]]></category>

		<guid isPermaLink="false">http://swamp.homelinux.net/blog/?p=77</guid>
		<description><![CDATA[I&#8217;ve been meaning to post these results for a while and with the Thanksgiving break here in the US, I have time to finally do it. When I ran my my original comparison, both the tests and databases were running on the same host connecting over the loopback interface. Using the loopback interface is a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been meaning to post these results for a while and with the Thanksgiving break here in the US, I have time to finally do it.</p>
<p>When I ran my my <a href="http://swamp.homelinux.net/blog/index.php/2009/03/03/performance-comparison-of-apache-mina-and-jboss-netty/">original comparison</a>, both the tests and databases were running on the same host connecting over the loopback interface.  Using the loopback interface is a good way to test but the performance characteristics of going over a real network are much different.  So I ran the tests again connecting to a second host over a gigabit/second Ethernet network.</p>
<p>I&#8217;ve also updated my tests to use the latest versions of both MINA and Netty.</p>
<p>Not only did I run the tests again over a real network connection, but I also added results for using Postgresql as well as the results of using plain JDBC and using JDBC with a thread-pool.  Each test executes 50 SELECT statements and each test was run 100 times.  Very interesting results.</p>
<table border="1">
<tr>
<th>Test</th>
<th>Mean</th>
</tr>
<tr>
<td>MySQL JDBC</td>
<td>23.03ms</td>
</tr>
<tr>
<td>MySQL JDBC/Thread-pool</td>
<td>69.89ms</td>
</tr>
<tr>
<td>MySQL ADBCJ/MINA</td>
<td>7.74ms</td>
</tr>
<tr>
<td>MySQL ADBCJ/Netty</td>
<td>4.84ms</td>
</tr>
<tr>
<td>Postgresql JDBC</td>
<td>25.95ms</td>
</tr>
<tr>
<td>Postgresql JDBC/Thread-pool</td>
<td>176.98ms</td>
</tr>
<tr>
<td>Postgresql ADBCJ/MINA</td>
<td>6.9ms</td>
</tr>
<tr>
<td>Postgresql ADBCJ/Netty</td>
<td>5.65ms</td>
</tr>
</table>
<p>An astute observer would question why JDBC is so much slower than both ADBCJ/MINA or ADBCJ/Netty.  The answer to that question is the fact that ADBCJ supports <a href="http://en.wikipedia.org/wiki/HTTP_pipelining">pipelining</a> which increases the performance of executing multiple queries significantly.</p>
<p>Netty continues to amaze and MINA is still really slow.  It&#8217;s unfortunate to see the slow progress of MINA.  While MINA 2.0 still hasn&#8217;t been released, Netty releases happen on a regular basis.  It&#8217;s true that I&#8217;m on the MINA PMC and I could help get a 2.0 release out the door but I just don&#8217;t have the time.  And honestly, why would I want to contribute to MINA when Netty is making faster progress and is frankly a better framework?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toadhead.net/index.php/2009/11/25/performance-comparison-of-apache-mina-and-jboss-netty-revisited/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Why is DataInputStream.read(byte[] b, int off, int len) declared final?</title>
		<link>http://blog.toadhead.net/index.php/2009/06/20/why-is-datainputstreamreadbyte-b-int-off-int-len-declared-final/</link>
		<comments>http://blog.toadhead.net/index.php/2009/06/20/why-is-datainputstreamreadbyte-b-int-off-int-len-declared-final/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 21:20:08 +0000</pubDate>
		<dc:creator>Mike Heath</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://swamp.homelinux.net/blog/?p=75</guid>
		<description><![CDATA[Why is DataInputStream.read(byte[] b, int off, int len) declared final? Stupid. Stupid. Stupid.]]></description>
			<content:encoded><![CDATA[<p>Why is DataInputStream.read(byte[] b, int off, int len) declared final?  Stupid.  Stupid.  Stupid.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toadhead.net/index.php/2009/06/20/why-is-datainputstreamreadbyte-b-int-off-int-len-declared-final/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utah Google Technology User Group</title>
		<link>http://blog.toadhead.net/index.php/2009/06/16/utah-google-technology-user-group/</link>
		<comments>http://blog.toadhead.net/index.php/2009/06/16/utah-google-technology-user-group/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 16:55:36 +0000</pubDate>
		<dc:creator>Mike Heath</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://swamp.homelinux.net/blog/?p=73</guid>
		<description><![CDATA[I am a big GWT fan and am excited about Google App Engine which is why some of my friends and I are starting the Utah Google Technology User Group. We&#8217;re just getting started and don&#8217;t yet have a place to meet but we&#8217;re working to get the word out. If you&#8217;re interested in participating, [...]]]></description>
			<content:encoded><![CDATA[<p>I am a big GWT fan and am excited about Google App Engine which is why some of my friends and I are starting the <a href="http://utahgtug.blogspot.com/">Utah Google Technology User Group</a>.  We&#8217;re just getting started and don&#8217;t yet have a place to meet but we&#8217;re working to get the word out.</p>
<p>If you&#8217;re interested in participating, please let us know.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toadhead.net/index.php/2009/06/16/utah-google-technology-user-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance comparison of Apache MINA and JBoss Netty</title>
		<link>http://blog.toadhead.net/index.php/2009/03/03/performance-comparison-of-apache-mina-and-jboss-netty/</link>
		<comments>http://blog.toadhead.net/index.php/2009/03/03/performance-comparison-of-apache-mina-and-jboss-netty/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 23:07:07 +0000</pubDate>
		<dc:creator>Mike Heath</dc:creator>
				<category><![CDATA[ADBCJ]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[MINA]]></category>
		<category><![CDATA[Netty]]></category>

		<guid isPermaLink="false">http://swamp.homelinux.net/blog/?p=71</guid>
		<description><![CDATA[One of my big complaints with Apache MINA is the high latency that&#8217;s incurred when sending data. MINA uses a set of I/O threads to handle reads and writes. This is typical of many non-blocking I/O frameworks. Netty is much more clever than MINA. In Netty, when you make a call to send data and [...]]]></description>
			<content:encoded><![CDATA[<p>One of my big complaints with <a href="http://mina.apache.org/">Apache MINA</a> is the high latency that&#8217;s incurred when sending data.  MINA uses a set of I/O threads to handle reads and writes.  This is typical of many non-blocking I/O frameworks.</p>
<p><a href="http://www.jboss.org/netty/">Netty</a> is much more clever than MINA.  In Netty, when you make a call to send data and the send queue is empty, Netty will just send the data.  We are using non-blocking I/O so the call will still be asynchronous.  If the send queue is not empty, Netty will queue up the data to be sent in much the same way that MINA does sends.  The Netty approach is much faster.</p>
<p>Using <a href="http://adbcj.org/">ADBCJ</a> I conducted a simple performance test comparing MINA and Netty.  The test runs 100 simple select SQL queries against MySQL that each return a single string.  Each test was run 100,000 times.</p>
<table border="1">
<tr>
<th> </th>
<th>Mean</th>
<th>Stdev</th>
</tr>
<tr>
<td>MINA</td>
<td>618,912,430.60ns</td>
<td>104,509,066.50ns</td>
</tr>
<tr>
<td>Netty</td>
<td>563,756,985.70ns</td>
<td>104,440,106.73ns</td>
</tr>
</table>
<p>As you can see, Netty is significantly faster.  In all the tests I&#8217;ve run so far, Netty has been faster.</p>
<p>To say I&#8217;m please with Netty would be an understatement.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toadhead.net/index.php/2009/03/03/performance-comparison-of-apache-mina-and-jboss-netty/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Van Jacobsen on Distributed Content Delivery</title>
		<link>http://blog.toadhead.net/index.php/2008/12/30/van-jacobsen-on-distributed-content-delivery/</link>
		<comments>http://blog.toadhead.net/index.php/2008/12/30/van-jacobsen-on-distributed-content-delivery/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 19:08:57 +0000</pubDate>
		<dc:creator>Mike Heath</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://swamp.homelinux.net/blog/?p=57</guid>
		<description><![CDATA[I recently saw this fascinating Google Tech Talk from Van Jacobsen. It&#8217;s a few years old but it&#8217;s one of those things I wish I would have scene years ago when I started grad school doing research in networking and the Internet. This talk really puts into perspective the importance of things like distributed hash [...]]]></description>
			<content:encoded><![CDATA[<p>I recently saw this fascinating Google Tech Talk from Van Jacobsen.  It&#8217;s a few years old but it&#8217;s one of those things I wish I would have scene years ago when I started grad school doing research in networking and the Internet.</p>
<p>This talk really puts into perspective the importance of things like distributed hash tables and other peer-to-peer technologies and shows that there&#8217;s more use for these technologies than just pirating software.</p>
<p><embed id="VideoPlayback" src="http://video.google.com/googleplayer.swf?docid=-6972678839686672840&#038;hl=en&#038;fs=true" style="width:400px;height:326px" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash"> </embed></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toadhead.net/index.php/2008/12/30/van-jacobsen-on-distributed-content-delivery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Picture on the Spring homepage</title>
		<link>http://blog.toadhead.net/index.php/2008/06/02/my-picture-on-the-spring-homepage/</link>
		<comments>http://blog.toadhead.net/index.php/2008/06/02/my-picture-on-the-spring-homepage/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 19:56:25 +0000</pubDate>
		<dc:creator>Mike Heath</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://swamp.homelinux.net/blog/index.php/2008/06/02/my-picture-on-the-spring-homepage/</guid>
		<description><![CDATA[I was just looking for some Spring documentation when I cam across this posting, http://springframework.org/node/654 that was linked from the Spring home page.  In the picture on the left, there&#8217;s a shiny head that I happened to recognize as my coworker, Jason Allen.  I looked a little closer and found myself in the picture.  I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>I was just looking for some Spring documentation when I cam across this posting, <a href="http://springframework.org/node/654">http://springframework.org/node/654</a> that was linked from the <a href="http://springframework.org/">Spring home page</a>.  In the picture on the left, there&#8217;s a shiny head that I happened to recognize as my coworker, Jason Allen.  I looked a little closer and found myself in the picture.  I&#8217;m the guy wearing the black baseball cap on the right of the picture.  You can also see the face of a good friend of mine, Mike Youngstrom, towards the back of the crowd.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toadhead.net/index.php/2008/06/02/my-picture-on-the-spring-homepage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

