<?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"
	>

<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's Blog</description>
	<pubDate>Sat, 19 Dec 2009 21:01:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<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. [...]]]></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>
		</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>
		</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>
		</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>
		</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 [...]]]></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>
		</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>
		</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>
		</item>
		<item>
		<title>openssl s_client</title>
		<link>http://blog.toadhead.net/index.php/2008/05/15/openssl-s_client/</link>
		<comments>http://blog.toadhead.net/index.php/2008/05/15/openssl-s_client/#comments</comments>
		<pubDate>Thu, 15 May 2008 23:44:31 +0000</pubDate>
		<dc:creator>Mike Heath</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[MINA]]></category>

		<guid isPermaLink="false">http://swamp.homelinux.net/blog/index.php/2008/05/15/openssl-s_client/</guid>
		<description><![CDATA[I&#8217;ve been playing with SSL client authentication in Apache httpd today at work.  It&#8217;s something I&#8217;ve always wanted to play with but haven&#8217;t had a good reason to invest the time until now.In the process of testing my configuration, I came across openssl s_client.  It&#8217;s one of those things I should have already known [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing with SSL client authentication in Apache httpd today at work.  It&#8217;s something I&#8217;ve always wanted to play with but haven&#8217;t had a good reason to invest the time until now.In the process of testing my configuration, I came across openssl s_client.  It&#8217;s one of those things I should have already known about but didn&#8217;t.  I wish I would have stumbled across it years ago.  Basically it works similar to nc (netcat) except you can use it with SSL/TLS.  So if you want to do HTTPS by hand to connect to Google you can do:
<pre>openssl s_client -connect google.com:443</pre>
<p>Google&#8217;s server will send back some information about your secure connection at which point you can type:
<pre>GET / HTTP/1.1Host: www.google.com</pre>
<p>(don&#8217;t forget an extra carriage return after the last line) and happily watch Google redirect you to a normal HTTP URL.openssl s_client will also let you do STARTTLS with SMTP.  I wish I would have known about that when I was building my SMTP server on MINA.  I implemented STARTTLS for it and and was an absolute pain to test and debug.  Using openssl would have made my life much easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toadhead.net/index.php/2008/05/15/openssl-s_client/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GSoC Application Rejected</title>
		<link>http://blog.toadhead.net/index.php/2008/04/21/gsoc-application-rejected/</link>
		<comments>http://blog.toadhead.net/index.php/2008/04/21/gsoc-application-rejected/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 22:56:52 +0000</pubDate>
		<dc:creator>Mike Heath</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[MINA]]></category>

		<guid isPermaLink="false">http://swamp.homelinux.net/blog/index.php/2008/04/21/gsoc-application-rejected/</guid>
		<description><![CDATA[I&#8217;m feeling a little bummed this afternoon.  I got the following email from the GSoC people:

Dear Applicant,

First of all, Google and the open source organizations taking part in
Google Summer of Code would like to thank for applying to take part in
the program this year. Unfortunately, your application was not one of
those selected to take [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m feeling a little bummed this afternoon.  I got the following email from the GSoC people:</p>
<pre>
Dear Applicant,

First of all, Google and the open source organizations taking part in
Google Summer of Code would like to thank for applying to take part in
the program this year. Unfortunately, your application was not one of
those selected to take part in the program. Universally, the quality
of the submitted applications was very high, but we had a limited
number of slots available. This often difficult decision was made by
the organization you applied to, so any questions regarding
application selection should be directed at them.

We hope you'll consider applying next year.

Kind regards,
The Google Summer of Code Program Administration Team</pre>
<p>The $4,500 stipend would have gone a long way towards a MacBook Pro and other fun toys.  Oh well.  I&#8217;ll just have to remain content with my employer issued Dell.</p>
<p>The good news is that I won&#8217;t have anything distracting me from getting my thesis done.  If you can call that good news&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toadhead.net/index.php/2008/04/21/gsoc-application-rejected/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using GIT to access the Apache Subversion Repository</title>
		<link>http://blog.toadhead.net/index.php/2008/02/28/using-git-to-access-the-apache-subversion-repository/</link>
		<comments>http://blog.toadhead.net/index.php/2008/02/28/using-git-to-access-the-apache-subversion-repository/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 22:18:43 +0000</pubDate>
		<dc:creator>Mike Heath</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://swamp.homelinux.net/blog/index.php/2008/02/28/using-git-to-access-the-apache-subversion-repository/</guid>
		<description><![CDATA[After upgrading Git to 1.5.4.2, I was having problems checking out projects from Apache&#8217;s subversion repository.  When I would try to do something like:

git svn clone --stdlayout https://svn.apache.org/repos/asf/mina/asyncweb
Git would output:

Initialized empty Git repository in .git/
Using higher level of URL: https://svn.apache.org/repos/asf/mina/asyncweb =&#62; https://svn.apache.org/repos/asf
W: Ignoring error from SVN, path probably does not exist: (175002): RA layer [...]]]></description>
			<content:encoded><![CDATA[<p>After upgrading <a href="http://git.or.cz/">Git</a> to 1.5.4.2, I was having problems checking out projects from Apache&#8217;s subversion repository.  When I would try to do something like:</p>
<pre>
git svn clone --stdlayout https://svn.apache.org/repos/asf/mina/asyncweb</pre>
<p>Git would output:</p>
<pre>
Initialized empty Git repository in .git/
Using higher level of URL: https://svn.apache.org/repos/asf/mina/asyncweb =&gt; https://svn.apache.org/repos/asf
W: Ignoring error from SVN, path probably does not exist: (175002): RA layer request failed: REPORT request failed on '/repos/asf/!svn/bc/100': REPORT of '/repos/asf/!svn/bc/100': Could not read chunk size: Secure connection truncated (https://svn.apache.org)
W: Do not be alarmed at the above message git-svn is just searching aggressively for old history.
This may take a while on large repositories</pre>
<p>It would churn for a LONG while and finally die spewing out:</p>
<pre>RA layer request failed: REPORT request failed on '/repos/asf/!svn/vcc/default': REPORT of '/repos/asf/!svn/vcc/default': 400 Bad Request (https://svn.apache.org) at /usr/bin/git-svn line 3813</pre>
<p>I Googled for a solution, of course, and didn&#8217;t find anything.  Git would create a project folder but it didn&#8217;t have anything in it except for the .git directory.  I tried doing a &#8216;git svn rebase&#8217; and it would fail.  Out of desperation I tried doing &#8216;git svn fetch&#8217; and voila!  Git started pulling down the project and its history.  It still takes a painfully long time to find the project&#8217;s history and fetch it but the flexibility and dynamics of Git make the required patience worth it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toadhead.net/index.php/2008/02/28/using-git-to-access-the-apache-subversion-repository/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
