<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Esoteric Curio</title>
    <link>http://lethargy.org/~jesus/</link>
    <description>Theo's Contributions to Technological Surreality</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.4.1 - http://www.s9y.org/</generator>
    <pubDate>Fri, 03 Sep 2010 01:26:43 GMT</pubDate>

    <image>
        <url>http://lethargy.org/~jesus/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Esoteric Curio - Theo's Contributions to Technological Surreality</title>
        <link>http://lethargy.org/~jesus/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Remiss regarding reading recommendations.</title>
    <link>http://lethargy.org/~jesus/writes/remiss-regarding-reading-recommendations</link>
            <category>Damaged Bits</category>
            <category>Rambling</category>
            <category>Writing</category>
    
    <comments>http://lethargy.org/~jesus/writes/remiss-regarding-reading-recommendations#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=188</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=188</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;p&gt;It&#039;s been ages since I wrote about a book I&#039;ve read.  I didn&#039;t stop reading, just sharing.&lt;/p&gt;

&lt;iframe src=&quot;http://rcm.amazon.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=lethargy-20&amp;o=1&amp;p=8&amp;l=as1&amp;m=amazon&amp;f=ifr&amp;md=10FE9736YVPPT7A0FBG2&amp;asins=B000PHOY0A&quot; style=&quot;float:left; width:120px;height:240px; margin-right:2em;&quot; scrolling=&quot;no&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;I recently read Jared Diamond&#039;s &quot;Gun, Germs &amp;amp; Steel.&quot;  I&#039;m not going to spoil the book, but not for the reason you think.  You can&#039;t spoil this book without regurgitating it in its entirety: it is pure content.  Every page is interesting and I refreshingly exercised my mind on the challenges of our world from an old-world perspective.  If you&#039;ve the time and patience (and haven&#039;t read it already), I highly recommend this book.  Plain and simple, it makes you think.  If you are like me (i.e. an entrepreneur or an engineer), you likely will think in atypical patterns.  Thinking differently means thinking smarter tomorrow.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

&lt;p&gt;If you&#039;ve read it, please let me know what you (as a fellow engineer) thought of this book.  Did you find it fascinating or is my head just malfunctioning?&lt;/p&gt;
&lt;br style=&quot;clear:left;&quot;/&gt; 
    </content:encoded>

    <pubDate>Thu, 02 Sep 2010 21:26:43 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/188</guid>
    
</item>
<item>
    <title>Designing for vendor malfunctions</title>
    <link>http://lethargy.org/~jesus/writes/designing-for-vendor-malfunctions</link>
            <category>Damaged Bits</category>
            <category>OpenSolaris</category>
            <category>PostgreSQL</category>
    
    <comments>http://lethargy.org/~jesus/writes/designing-for-vendor-malfunctions#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=187</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=187</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;p&gt;Many people have asked me how &lt;a href=&quot;http://www.channelregister.co.uk/2010/08/13/opensolaris_is_dead/&quot;&gt;Oracle&#039;s recent actions&lt;/a&gt; will affect OmniTI and our clients.  As you may or may not know, a considerable amount of OmniTI&#039;s internal infrastructure is built around the OpenSolaris platform.  Given Oracle&#039;s recent announcement about their path forward toward Solaris 11, what does that mean for OmniTI and OmniTI&#039;s customers?&lt;/p&gt;

&lt;p&gt;In short: what&#039;s old is new and what&#039;s new is old and business as usual.&lt;/p&gt;

&lt;p&gt;The long of it has very little to do with Oracle and a lot to do with how we operate here at &lt;a href=&quot;http://omniti.com&quot;&gt;OmniTI&lt;/a&gt;. For a little over ten years, I&#039;ve been on the international conference circuit speaking on the subject of scalable architecture design and implementation.  While these talks discuss design patterns for scalable systems, they also strongly emphasize both strategic and tactical technology selection.  One of the things I hope that attendees left with is a mission to maintain a strategy for avoiding technical lock in.  A quick recapitulation:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;
If a vendor tells you (or you believe) that their solution is the only way to solve a particular problem, find another way.  If there are multiple solutions to your problem and theirs is the &quot;best,&quot; that is where the conversations start, business is won and relationships are made. Additionally, understand that the solution a vendor sells you is not for &lt;em&gt;your&lt;/em&gt; problem; rather, it is for the portion of your problem that is shared by other companies in the target audience for that particular product. Armed with this information, apply some critical thinking when selecting technology. At OmniTI, we think critically… always.
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div style=&quot;float:right; text-align:center; margin-left: 1em; padding:4px; border: 1px solid #aaa;&quot;&gt;
&lt;img src=&quot;http://farm4.static.flickr.com/3573/3512855593_122994b8c6.jpg&quot; width=&quot;334&quot; height=&quot;500&quot; alt=&quot;bridge construction&quot; /&gt;&lt;br /&gt;
&amp;copy; jamiejohndavies, 2009 (&lt;a href=&quot;http://www.flickr.com/photos/jamiejohn/3512855593/&quot;&gt;orig&lt;/a&gt;)
&lt;/div&gt;

&lt;p&gt;Oracle recently made a decision to close the development processes around the future of Solaris.  I am personally disappointed by their decision and it will necessarily mean that my participation in the OpenSolaris community will stop (as the community will no longer exist). While I am personally disappointed, I believe that their proposed business plan for Solaris 11 is sensible and will add more shareholder value over the short and medium term. As for the long term, the classic tech &quot;long term&quot; strategy applies: adapt to the market as it changes.  Ellison has, in my opinion, been true and good to his shareholders.  Back to how this affects OmniTI and our customers, we purchased Solaris 10 with support and we planned to purchase Solaris 11 with support.  While the lack of nightly code drops and open development makes Solaris 11 less valuable, it is still valuable.&lt;/p&gt;

&lt;p&gt;As with every technology selection we make, we reevaluate regularly to confirm that our decision remains correct.  Additionally, we always implement systems in such a way that technology components can be gutted and replaced with relative ease.  Could we transition our infrastructure from OpenSolaris to FreeBSD and/or Linux? Yes. Would the transition be relatively quick and painless? Yes. Why? Our job is to design, implement and operate systems that survive software malfunctions, hardware malfunctions, &lt;em&gt;and&lt;/em&gt; vendor malfunctions. We&#039;ve done our job by strategically designing our systems and maintaining the discipline in our tactical maneuvers that ensure our customers vitality even under changing circumstances.&lt;/p&gt;

&lt;p&gt;Will we be moving our Solaris-based platforms away from Oracle? Based on what I know today, no. Will we be moving our OpenSolaris-based platforms away from Oracle? Maybe. We&#039;ll wait and see and cross that bridge if needed. Why such a casual attitude? At OmniTI we spend time throughout every project engineering and maintaining those bridges.  When the time comes to cross one, it is a simple and casual stroll.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Wed, 18 Aug 2010 22:14:22 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/187</guid>
    
</item>
<item>
    <title>Reconnoiter at OSCON 2010</title>
    <link>http://lethargy.org/~jesus/writes/reconnoiter-at-oscon-2010</link>
            <category>Damaged Bits</category>
            <category>OpenSolaris</category>
            <category>PostgreSQL</category>
    
    <comments>http://lethargy.org/~jesus/writes/reconnoiter-at-oscon-2010#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=186</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=186</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;div style=&quot;float:left; margin: 0em 1em 1em 0em; width:425px&quot; id=&quot;__ss_4884349&quot;&gt;&lt;strong style=&quot;display:block;margin:0px 0 4px&quot;&gt;&lt;a href=&quot;http://www.slideshare.net/postwait/noit-ocon2010&quot; title=&quot;Reconnoiter at OSCON 2010&quot;&gt;Reconnoiter: Large scale trending and fault detection&lt;/a&gt;&lt;/strong&gt;&lt;object id=&quot;__sse4884349&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=noit-ocon-2010-100801164551-phpapp02&amp;stripped_title=noit-ocon2010&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;embed name=&quot;__sse4884349&quot; src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=noit-ocon-2010-100801164551-phpapp02&amp;stripped_title=noit-ocon2010&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style=&quot;padding:5px 0 12px&quot;&gt;View more &lt;a href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a href=&quot;http://www.slideshare.net/postwait&quot;&gt;postwait&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;

&lt;p style=&quot;margin-top: 3em&quot;&gt;Several people have asked me to post my OSCON Reconnoiter slides.  Honestly, I was reticent at first because the presentation was packed full with oral content not in the slides and it had nice screencasts that end up turning into a crazy-large online movie.  Suffice it to say, you need to attend to get real info out of it.&lt;/p&gt;

&lt;p&gt;Despite my reservations, here is the PDF version of my slides with screencasts omitted.&lt;/p&gt;

&lt;p&gt;If you want to see something largely the same (but with me talking at you and nice video) take a look at the nice production &lt;a href=&quot;http://omniti.com/is/miguel-montanez&quot;&gt;Miguel&lt;/a&gt; put together of my OSCON 2009 &lt;a href=&quot;http://omniti.com/video/noit-oscon-demo&quot;&gt;reconnoiter presentation&lt;/a&gt;.&lt;/p&gt;

&lt;br style=&quot;clear:left&quot;/&gt; 
    </content:encoded>

    <pubDate>Sun, 01 Aug 2010 17:53:58 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/186</guid>
    
</item>
<item>
    <title>Insight into the wild and crazy OmniTI</title>
    <link>http://lethargy.org/~jesus/writes/insight-into-the-wild-and-crazy-omniti</link>
            <category>PostgreSQL</category>
    
    <comments>http://lethargy.org/~jesus/writes/insight-into-the-wild-and-crazy-omniti#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=185</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=185</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;a href=&quot;http://webpulp.tv&quot;&gt;&lt;img src=&quot;http://lethargy.org/~jesus/uploads/webpulp-snap.jpg&quot; width=&quot;200&quot; height=&quot;149&quot; style=&quot;float:right; margin:0em 1em&quot;/&gt;&lt;/a&gt;&lt;p&gt;I recently had the privilege of being interviewed by Josh Ownes over at &lt;a href=&quot;http://webpulp.tv&quot;&gt;Webpulp.tv&lt;/a&gt; about all sorts of things.  It&#039;s rare that I get time to sit down and think about all the crazy stuff we do at &lt;a href=&quot;http://omniti.com/&quot;&gt;OmniTI&lt;/a&gt; let alone talk about it.  Aside from a camera angle that is quite odd and very poor picture quality, the interview is really nice.  While I typically don&#039;t watch or listen to my own media events (it&#039;s eerie), in this interview I actually enjoyed listening from start to end because it is a fairly fun list of wild and crazy things we to at OmniTI in unconventional depth.&lt;/p&gt;

&lt;p&gt;Almost everything Josh and I talk about happened this year!  And it&#039;s only half over!  2010 is really the &quot;year of awesome&quot; for innovation at OmniTI.  We did cheat a bit by having several exciting things hidden in the oven nearing the end of 2009.&lt;/p&gt;

&lt;p&gt;If you want to know what I do and what OmniTI does on a daily basis, I think &lt;a href=&quot;http://webpulp.tv/post/816582386/omniti-theo-schlossnagle&quot;&gt;this interview gives a lot of insight&lt;/a&gt;.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 20 Jul 2010 01:23:07 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/185</guid>
    
</item>
<item>
    <title>Operating at Scale</title>
    <link>http://lethargy.org/~jesus/writes/operating-at-scale</link>
            <category>Damaged Bits</category>
            <category>OpenSolaris</category>
            <category>PostgreSQL</category>
            <category>Writing</category>
    
    <comments>http://lethargy.org/~jesus/writes/operating-at-scale#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=184</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=184</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;div&gt;&lt;p&gt;As requested, here is my slide stack bereft of wit and cynicism:&lt;/p&gt;

&lt;div style=&quot;float:left; margin: 0em 1em 1em 0em; width:425px&quot; id=&quot;__ss_4577045&quot;&gt;&lt;strong style=&quot;display:block;margin:12px 0 4px&quot;&gt;&lt;a href=&quot;http://www.slideshare.net/postwait/velocity-2010-scalable-internet-architectures&quot; title=&quot;Velocity 2010: Scalable Internet Architectures&quot;&gt;Velocity 2010: Scalable Internet Architectures&lt;/a&gt;&lt;/strong&gt;&lt;object id=&quot;__sse4577045&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sia2010-100622132939-phpapp02&amp;stripped_title=velocity-2010-scalable-internet-architectures&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;embed name=&quot;__sse4577045&quot; src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sia2010-100622132939-phpapp02&amp;stripped_title=velocity-2010-scalable-internet-architectures&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style=&quot;padding:5px 0 12px&quot;&gt;View more &lt;a href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a href=&quot;http://www.slideshare.net/postwait&quot;&gt;postwait&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;

&lt;p style=&quot;margin-top: 3em&quot;&gt;I just finished my presentation at this year&#039;s &lt;a href=&quot;http://en.oreilly.com/velocity2010&quot;&gt;Velocity Conference&lt;/a&gt;.  Thank you all for the warm reception and the positive feedback.  This year&#039;s conference is going to be awesome.  If you didn&#039;t make it this year make sure you sign up early next year; Velocity is not an event to be missed.  If you want some more scalability goodness this year in conference form, consider attending &lt;a href=&quot;http://omniti.com/surge/2010&quot;&gt;Surge&lt;/a&gt;; it&#039;s going to kick ass.&lt;/p&gt;

&lt;br style=&quot;clear:left;&quot;/&gt;
&lt;/div&gt; 
    </content:encoded>

    <pubDate>Tue, 22 Jun 2010 14:37:44 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/184</guid>
    
</item>
<item>
    <title>ZFS and Zetaback win again</title>
    <link>http://lethargy.org/~jesus/writes/zfs-and-zetaback-win-again</link>
            <category>Damaged Bits</category>
            <category>OpenSolaris</category>
            <category>PostgreSQL</category>
    
    <comments>http://lethargy.org/~jesus/writes/zfs-and-zetaback-win-again#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=183</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=183</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;blockquote&gt;
&lt;p&gt;Now that it&#039;s all set up, I gotta say, I think zetaback is the best thing since sliced bread for backing up big file servers.&lt;/p&gt;
&lt;p&gt;We have an OpenSolaris file server with about 3TB of data, mostly in home directories.  The kind of work my users do means that a lot of this data is in millions of small files.  A full backup via rsync took a week; even a mostly empty incremental would take several hours due to rsync having to walk the tree and stat all those files.  zetaback did a full backup in about two and a half days (mostly limited by the CPU speed of my backup server, since I&#039;m using gzip compression) and an incremental took less than half an hour.&lt;/p&gt;
&lt;p&gt;
--&lt;br/&gt; 
David Brodbeck&lt;br/&gt;
System Administrator, Linguistics&lt;br/&gt;
University of Washington
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;While I think that most of the accolades here go to the awesomeness that is ZFS, it is very nice to see that Zetaback has so elegantly made this magic accessible.&lt;/p&gt;

&lt;p&gt;Congratulations to everyone what has made &lt;a href=&quot;http://labs.omniti.com/trac/zetaback&quot;&gt;Zetaback&lt;/a&gt; what it is.&lt;/a&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 18 Jun 2010 12:33:55 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/183</guid>
    
</item>
<item>
    <title>Surge: scalability matters</title>
    <link>http://lethargy.org/~jesus/writes/surge-scalability-matters</link>
            <category>Damaged Bits</category>
            <category>OpenSolaris</category>
            <category>PostgreSQL</category>
    
    <comments>http://lethargy.org/~jesus/writes/surge-scalability-matters#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=182</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=182</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;p&gt;I&#039;ve been attending conference in the &quot;Internet space&quot; regularly for about 12 years.  I have enjoyed conferences about web technologies, open source, and programming languages technologies.  Many, though not all, of the conferences I&#039;ve enjoyed have been put on by O&#039;Reilly &amp;#8212; they put on some good shows.&lt;/p&gt;

&lt;p&gt;Over the last two years I have immensely enjoyed my involvement with the &lt;a href=&quot;http://en.oreilly.com/velocity2010&quot;&gt;Velocity conference&lt;/a&gt;.  It is, in my opinion, the de facto conference on web performance and operations.  Operations is about keeping it all running and web performance has embraced a definition of speedy content delivery and efficient browser execution.  These two aspects of running large customer-facing systems are critical, but they are the bread of a sandwich and the meat is the &quot;architecture.&quot;&lt;/p&gt;

&lt;p&gt;So, where&#039;s the conference about how to architect systems that scale?  I thought it might have been &lt;a href=&quot;http://events.gigaom.com/structure/10/&quot;&gt;Structure&lt;/a&gt;, but this year&#039;s &quot;buzz-compliant&quot; cloud theme leaves me with a confident and resounding &quot;no.&quot;  &lt;a href=&quot;http://omniti.com/seeds/the-cloud-is-great-stop-the-hype&quot;&gt;Clouds aren&#039;t &lt;em&gt;how&lt;/em&gt; you design and build scalable systems&lt;/a&gt;, they are simply one of many valid places &quot;where&quot; you build your design.&lt;/p&gt;

&lt;p&gt;Fed up with all that, I went back home to &lt;a href=&quot;http://omniti.com&quot;&gt;OmniTI&lt;/a&gt; and asked &quot;what can we do about this?&quot;  Our answer? &lt;a href=&quot;http://omniti.com/surge/2010&quot;&gt;Surge&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote style=&quot;background:#fff&quot;&gt;
&lt;p&gt;&lt;a href=&quot;http://omniti.com/surge/2010&quot;&gt;&lt;img style=&quot;float:right;margin:0.5em&quot; src=&quot;http://s.omniti.net/surge/i/present/logo-main.png&quot;/&gt;&lt;/a&gt; OmniTI has a reputation for scalable web applications and architectures. We didn&#039;t learn this stuff overnight. Like many of the success stories at Surge, we acquired experience through trial and error, constant collaboration between development and operations teams, and an unwavering commitment to excellence. But we still lean on our friends and peers to see how things can be done better.&lt;/p&gt;

&lt;p&gt;Surge started as the brainchild of our employees wanting to bring the best and brightest in Web Operations to our own backyard...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I have to say that I have never before been so excited by a conference. Surge is the &quot;&lt;em&gt;how&lt;/em&gt; to scale&quot; conference.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 04 Jun 2010 15:22:37 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/182</guid>
    
</item>
<item>
    <title>Vibram Four Fingers: Syndactyly Successful</title>
    <link>http://lethargy.org/~jesus/writes/vibram-four-fingers-syndactyly-successful</link>
            <category>Rambling</category>
    
    <comments>http://lethargy.org/~jesus/writes/vibram-four-fingers-syndactyly-successful#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=181</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=181</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;p&gt;These are vibram five fingers:&lt;/p&gt;

&lt;img src=&quot;http://lethargy.org/theo/photos/Shoots/2010/05/23/IMG_0837.jpg&quot; width=&quot;580px&quot;/&gt;

&lt;p&gt;However, I have &lt;a href=&quot;http://en.wikipedia.org/wiki/Syndactyly&quot;&gt;syndactyly&lt;/a&gt; affecting both of my feet.&lt;/p&gt;

&lt;p&gt;I love the idea of having my toes separated which is why I prefer barefoot so much more than shoes.  Vibram five fingers have always appealed to me. However, I cannot wear them.  I wrote Vibram and asked for a pair of shoes to cut up and make acceptable for all the people with toes like mine, but they seemed completely uninterested.&lt;/p&gt;

&lt;p&gt;This weekend, I finally took the risk and bought shoes I cannot even try on.  And here is my short, simple and successful journey.&lt;/p&gt;

&lt;p&gt;First I cut down the side walls between the second and third toes. I trimmed the fabric a few millimeters from the rubber sole and about four millimeters from the top seam (where grey meets black).  Stopping here gives me wearable shoes that would collect rocks and offer a separation of the sole between the second and third toes that would be quite uncomfortable to walk in after a while.&lt;/p&gt;

&lt;img src=&quot;http://lethargy.org/theo/photos/Shoots/2010/05/23/IMG_0839.jpg&quot; width=&quot;580px&quot;/&gt;

&lt;p&gt;The next part lack photography as the working space was very small and I couldn&#039;t take any solid pictures.  However, I used grey embroidery thread to loop-stich the two toe soles together from the inside leaving the bottom attached:&lt;/p&gt;

&lt;img src=&quot;http://lethargy.org/theo/photos/Shoots/2010/05/23/IMG_0841.jpg&quot; width=&quot;580px&quot;/&gt;

&lt;p&gt;Then I did my best at a plait stitch (which I&#039;ll admit I did poorly) across the top of the toes from seam to seam:&lt;/p&gt;

&lt;img src=&quot;http://lethargy.org/theo/photos/Shoots/2010/05/23/IMG_0840.jpg&quot; width=&quot;580px&quot;/&gt;

&lt;p&gt;And then I can slip my darling feet into them:&lt;/p&gt;

&lt;img src=&quot;http://lethargy.org/theo/photos/Shoots/2010/05/23/IMG_0842.jpg&quot; width=&quot;290px&quot;/&gt;&lt;img src=&quot;http://lethargy.org/theo/photos/Shoots/2010/05/23/IMG_0843.jpg&quot; width=&quot;290px&quot;/&gt;

&lt;p&gt;All in all, this took about an hour for the first shoe and about a half hour of the second shoe.  I&#039;m pleased.  It turned out well.  These are my Vibram &quot;syndactyly-enabled&quot; Four Fingers. &lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 23 May 2010 21:21:39 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/181</guid>
    
</item>
<item>
    <title>Plan Wagon</title>
    <link>http://lethargy.org/~jesus/writes/plan-wagon</link>
            <category>Damaged Bits</category>
            <category>OpenSolaris</category>
            <category>PostgreSQL</category>
            <category>Rambling</category>
    
    <comments>http://lethargy.org/~jesus/writes/plan-wagon#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=180</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=180</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;p&gt;What does it mean to architect a system?  It means you solve
problems.&lt;/p&gt; 
 
&lt;p&gt;While that might seem simple, I am absolutely dumbfounded by the
number of people that attempt to solve their problem by simply
applying the solution to someone else&#039;s problem without any sort of
reasonable thought process.&lt;/p&gt; 
 
&lt;p&gt;Let me tell you all about &quot;Plan Wagon.&quot;&lt;/p&gt; 
 
&lt;blockquote&gt; 
&lt;p&gt;Bob&#039;s a great parent.  In fact most people that know Bob are
extremely impressed by Bob&#039;s parenting skills.  He spends time with
his kids and one of his favorite things to do with them is take them
for wagon rides around the neighborhood.  Bob&#039;s blogged a few times
about how challenging it was to take his kids around the block before
(as they were all different ages with different walking speeds and
attention spans), but now with the wagon &amp;#8212; life is swell.&lt;/p&gt; 
 
&lt;p&gt;Jack reads Bob&#039;s blog amongst many others, and he himself has some
experience with wagons and knows how they operate. He was a child
once and just the other day saw someone transporting some children in
a wagon.  Jack is an important player in education: he coordinates
various programs and has been very successful.&lt;/p&gt; 
 
&lt;p&gt;Jack is posed with a challenge at work: a new educational program
being offered will serve 120 children ages 4 through 9 across a suburb
and his organization must provide transportation.  Jack feels
confident.  Jack knows Bob&#039;s success with wagons.  Jack has used a
wagon, has seen them work.  Jack purchases a fleet of 64 wagons. He
figures that two kids per wagon would work fine and that having four
extra will leave some to be used if another wagon needs servicing.
Now, who will pull them?  Well, with 60 wagons, you&#039;ll need at least
60 adults.  And the distance to be covered is about 4 miles, so they
should allot for approximately 2 hours each way of travel time.&lt;/p&gt; 
 
&lt;p&gt;A casual observer notes to Jack that perhaps a transport with
higher service capacity and faster travel time might be more
appropriate.  Jack is irritated because he knows that the wagons will
work (and BTW, he is correct).  Despite his irritation at being
distracted from ironing out the implementation details of &quot;Plan Wagon&quot;
he does some research.  Jack finds that a both a Boeing 737 and an
Airbus A320 will hold 120 children and go around 500 miles per
hour.  But, clearly those are impractical because of the cost.&lt;/p&gt; 
 
&lt;p&gt;A colleague of Jack&#039;s suggests that perhaps buses should be used.
Jack, of course, knows exactly what these are.  However, Jack doesn&#039;t
have a C class license so cannot drive a bus, nor has Jack ever fixed
a bus, and buses typically don&#039;t have seatbelts, which has always
concerned Jack.  Jack is confident that were something to go wrong
with &quot;Plan Wagon&quot; he could act in any role required to facilitate
success.&lt;/p&gt; 
 
&lt;p&gt;Jack sleeps on it.  After reviewing the facts he comes to a
decision.  Jack&#039;s goal is to move different aged children around the
suburbs.  Jack knows that Bob effectively moves children around his
suburb on wagons and the choice of a wagon made Bob happy, popular and
solved the critically important problem of varying mobility of
children of different ages that Jack is sure to face.  Jack goes ahead
with &quot;Plan Wagon.&quot;&lt;/p&gt; 
 
&lt;p&gt;Jack is an ignorant ass clown.&lt;/p&gt; 
&lt;/blockquote&gt; 
 
&lt;p&gt;Now, in reality, Jack&#039;s &quot;Plan Wagon&quot; can work.  It&#039;s overly
expensive and painfully suboptimal, but possible nonetheless.  The
issue here was very obvious: Bob&#039;s problem and Jack&#039;s problem were
different &amp;#8212; no matter how much Jack wished otherwise.  For some
reason, in technology, even seemingly smart people act like Jack.&lt;/p&gt; 
 
&lt;p&gt;People
applying &lt;a href=&quot;http://en.wikipedia.org/wiki/NoSQL&quot;&gt;NoSQL&lt;/a&gt; to
problems that would clearly benefit from deep relational
management. People applying
traditional &lt;a href=&quot;http://en.wikipedia.org/wiki/Database_management_system&quot;&gt;DBMS&lt;/a&gt; 
to problems that require no atomicity, isolation or
consistency. People who feel they need to
use &lt;a href=&quot;http://hadoop.apache.org/&quot;&gt;Hadoop&lt;/a&gt; to process a mere
terabyte of data.  These technologies aren&#039;t &quot;wrong&quot; &amp;#8212; but can&#039;t be
considered &quot;solutions&quot; when they are applied to the wrong problem.&lt;/p&gt; 
 
&lt;p&gt;Here&#039;s an idea: how about understanding the problem before you try
to solve it?  I know it&#039;s a radical concept, but it might just help.
I would argue that almost every solution has at least two legitimate
technology selections that can be cleanly applied.  In other words, if
I need a strong DBMS, chances are good that
both &lt;a href=&quot;http://www.postgresql.org/&quot;&gt;PostgreSQL&lt;/a&gt; 
or &lt;a href=&quot;http://www.oracle.com/us/products/database/index.html&quot;&gt;Oracle&lt;/a&gt; 
will work.  If I need a horizontally scalable key-value store,
likely &lt;a href=&quot;http://cassandra.apache.org/&quot;&gt;Cassandra&lt;/a&gt; 
or &lt;a href=&quot;http://project-voldemort.com/&quot;&gt;Voldemort&lt;/a&gt; 
(or &lt;a href=&quot;http://www.mongodb.org/&quot;&gt;MongoDB&lt;/a&gt; 
or &lt;a href=&quot;http://couchdb.apache.org/&quot;&gt;CouchDB&lt;/a&gt;) will work.  Now
stop.  I&#039;m not telling you to look hard at the differences between
Cassandra and Voldemort, I&#039;m tell you to look hard at the differences
between a DMBS and a key-value store. Do not assume that because you
are building an app &quot;today&quot; that you it must be powered by a key-value
store.&lt;/p&gt; 
 
&lt;p&gt;Next time you are posed a problem and you pick up your favorite
tools &amp;#8212; &lt;em&gt;put them down&lt;/em&gt;. Why? It might just force to think about what
you are building instead of the tools you are using.  Be an engineer
and think about the solution to the problem rather than the building
materials and tools.&lt;/p&gt; 
 
&lt;p&gt;At OmniTI, we hire engineers and often immediately have them use a
language and a database and an operating system they don&#039;t know.  It
separates the engineers from the programmers &amp;#8212; programmers are a dime
a dozen.&lt;/p&gt; 
 
&lt;p&gt;Unfortunately, engineers are hard to find.  If you want to be an
engineer consider &lt;a href=&quot;http://omniti.com/&quot;&gt;OmniTI as a home for
engineers&lt;/a&gt;.  It was built by engineers and continues to be run by
engineers.  &lt;a href=&quot;http://omniti.com/is/hiring&quot;&gt;We&#039;re hiring&lt;/a&gt; 
people that are more excited about the solutions they produce than
they are about the tools they
use.  &lt;a href=&quot;http://omniti.com/is/hiring&quot;&gt;We&#039;re hiring&lt;/a&gt; people
that want to solve problems right and can restrain themselves from
trying to jam a square peg in a round hole just because the peg is
shiny or familiar.  We&#039;re looking for people that care to understand a
problem before they solve it.  Ignorant ass clowns need not apply.&lt;/p&gt; 
 
&lt;p&gt;Regardless of who you are and what you are doing: avoid &quot;Plan
Wagon.&quot;&lt;/p&gt;  
    </content:encoded>

    <pubDate>Mon, 10 May 2010 10:54:33 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/180</guid>
    
</item>
<item>
    <title>pg_controldata from SQL</title>
    <link>http://lethargy.org/~jesus/writes/pg_controldata-from-sql</link>
            <category>Damaged Bits</category>
            <category>OpenSolaris</category>
            <category>PostgreSQL</category>
    
    <comments>http://lethargy.org/~jesus/writes/pg_controldata-from-sql#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=179</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=179</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;p&gt;Like many database, PostgreSQL stores critical (minimal) state about the database in what is called a &quot;control file.&quot;  This control file has valuable information in it that speaks to backups, checkpoints, block sizes, etc.  PostgreSQL ships a tool called pg_controldata to dump this file&#039;s values in human-readable form.  I&#039;ve been frustrated in the past that you can&#039;t see all these values from within a PostgreSQL SQL session.  At some point in the past I got in an argument about the usefulness of such a feature and I pretty well lost that argument: a postgres control file on an active database doesn&#039;t really show you (much) useful information and you really need it when the database is off (which is what pg_controldata provides).&lt;/p&gt;

&lt;p&gt;PostgreSQL 9.0 changes the game.  You can run queries on a database that isn&#039;t active (particularly a standby database that is applying WAL files).  Now this feature becomes much more interesting.  I can use monitoring tools with SQL-only access to find out extremely useful things about the state of the standby.&lt;/p&gt;

&lt;p&gt;I have to say, of all the postgres extensions I&#039;ve written, &lt;a href=&quot;http://labs.omniti.com/trac/pgtreats/browser/trunk/contrib/control&quot;&gt;controldata&lt;/a&gt; had to be the simplest.  Hopefully it is useful to someone other than just &lt;a href=&quot;http://omniti.com/&quot;&gt;us&lt;/a&gt;.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 29 Apr 2010 09:45:48 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/179</guid>
    
</item>
<item>
    <title>from pcap to postgres: forensic performance analysis</title>
    <link>http://lethargy.org/~jesus/writes/from-pcap-to-postgres-forensic-performance-analysis</link>
            <category>OpenSolaris</category>
            <category>PostgreSQL</category>
    
    <comments>http://lethargy.org/~jesus/writes/from-pcap-to-postgres-forensic-performance-analysis#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=178</wfw:comment>

    <slash:comments>5</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=178</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;p&gt;Last week &lt;a href=&quot;http://omniti.com/is/robert-treat&quot;&gt;Robert Treat&lt;/a&gt; told me it sure would be nice if we could reconstruct &lt;a href=&quot;http://www.postgresql.org/&quot;&gt;PostgreSQL&lt;/a&gt; logs from network captures (in the sort of antagonist way that is: &quot;MySQL can do it, why can&#039;t we?&quot;).  With &lt;a href=&quot;http://labs.omniti.com/trac/pgtreats/wiki/pgsniff&quot;&gt;pgsniff&lt;/a&gt;, we can.&lt;/p&gt;

&lt;p&gt;Well, it turns out that he was complaining for a reason: a client.  Our friends over at &lt;a href=&quot;http://etsy.com&quot;&gt;Etsy&lt;/a&gt; have a server that is so blindingly busy selling handmade things that logging all queries on the box degrades performance unacceptably.  This is actually a common problem for PostgreSQL and other databases alike.  Most databases offer a feature to log all queries where a single execution exceeds some arbitrarily chosen wall clock time. It turns out this &quot;solution&quot; is acutely painful because it often causes engineers to look at incomplete data and draw (you guessed it) incorrect conclusions.&lt;/p&gt;

&lt;p&gt;The concept of a &quot;slow query log&quot; is a woefully incomplete concept.  Typically, such a log is configured to track queries that spend more than X amount of time executing, where X is some &quot;small enough number.&quot;  Some sites put this at 1 second.  If I execute a query (with any sort of high frequency) that takes one second to complete, I&#039;m flat-out screwed.  So, by the laws of physics, the queries that get logged under such circumstances are outliers (in high transaction, OLTP systems).  The common approach to address this is to set X down to 100ms or 10ms.  Any good engineer should realize that by doing so you simply change the resolution of the problem and have fixed nothing.  The database behaves how it does because of &lt;em&gt;all&lt;/em&gt; that it does.  The queries you really care about are those that consume the most cumulative execution time, but to determine this you must account for &lt;em&gt;everything&lt;/em&gt;.  This is why turning on full query logging is essential to thorough performance analysis.&lt;/p&gt;

&lt;p&gt;Now, most of my readers know I&#039;m a DTrace fan and, yes, I&#039;ve been able to do this in real-time, in production on all our Solaris-based PostgreSQL servers for years.  However, &lt;a href=&quot;http://labs.omniti.com/trac/pgtreats/wiki/pgsniff&quot;&gt;pgsniff&lt;/a&gt; is a callout to all you guys without DTrace.  This tool takes pcap information (from a live interface or post-mortem &lt;a href=&quot;http://www.tcpdump.org/&quot;&gt;tcpdump&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The tool is a bit rough around the edges and some of the tuple tracking is buggy, but it is already in a form that is spectacularly useful.  You can now tcpdump on a machine that can see the traffic (db, web server, monitor port) and reconstruct every query (even in more detail that PostgreSQL&#039;s logs provide).  On the TODO list: fix bugs, production trials, and bind variable reconstruction so that one can dive into a slow outlier and see the bind variables used during execution of prepared statements.&lt;/p&gt;

&lt;p&gt;For now, you can get the code via Subversion here: &lt;a href=&quot;https://labs.omniti.com/pgtreats/trunk/Sniffer-Postgres/&quot;&gt;https://labs.omniti.com/pgtreats/trunk/Sniffer-Postgres/&lt;/a&gt;.  Once some of the features are fleshed out and it has more production run-time I will put it up on &lt;a href=&quot;http://www.cpan.org/&quot;&gt;CPAN&lt;/a&gt;.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 02 Apr 2010 09:52:07 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/178</guid>
    
</item>
<item>
    <title>pg_amqp slides from PgEast2010</title>
    <link>http://lethargy.org/~jesus/writes/pg_amqp-slides-from-pgeast2010</link>
            <category>BWPUG</category>
            <category>Damaged Bits</category>
            <category>OpenSolaris</category>
            <category>PostgreSQL</category>
    
    <comments>http://lethargy.org/~jesus/writes/pg_amqp-slides-from-pgeast2010#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=177</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=177</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;p&gt;This past week I had the privilege of presenting along side many distinguished speakers at this year&#039;s PostgreSQL Conference East 2010 in Philadelphia, PA.  I presented &lt;a href=&quot;http://www.slideshare.net/postwait/postgresql-meet-your-queue&quot;&gt;PostgreSQL: meet your queue&lt;/a&gt; which was received even more warmly than I had anticipated.  I really think that cueing your database to publish over AMQP is the bees knees and it turns out I wasn&#039;t alone!&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 30 Mar 2010 00:55:40 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/177</guid>
    
</item>
<item>
    <title>Thoughts on the cloud</title>
    <link>http://lethargy.org/~jesus/writes/thoughts-on-the-cloud</link>
            <category>Damaged Bits</category>
            <category>OpenSolaris</category>
            <category>PostgreSQL</category>
    
    <comments>http://lethargy.org/~jesus/writes/thoughts-on-the-cloud#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=176</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=176</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;p&gt;A couple of people have asked me to share my opinion on the cloud.  I&#039;ve been hesitant to talk about the cloud, because of the fanatics and funding; the hype makes people deaf to reason.  So, instead of talking about the cloud, here&#039;s a technical discussion of cloud technology that attempts to dismantle the hype.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;... what’s the problem? The hype. The hype is the problem. With hype come straw man arguments that delay or hold back the healthy evolution and incorporation of this technological paradigm.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Read more of &lt;a href=&quot;http://omniti.com/seeds/the-cloud-is-great-stop-the-hype&quot;&gt;&quot;The cloud is great. Stop the hype.&quot;&lt;/a&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 23 Mar 2010 10:10:55 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/176</guid>
    
</item>
<item>
    <title>Managing risk by deploying incessantly</title>
    <link>http://lethargy.org/~jesus/writes/managing-risk-by-deploying-incessantly</link>
            <category>Damaged Bits</category>
            <category>OpenSolaris</category>
            <category>PostgreSQL</category>
    
    <comments>http://lethargy.org/~jesus/writes/managing-risk-by-deploying-incessantly#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=175</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=175</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;p&gt;I recently took the time to write down &lt;a href=&quot;http://omniti.com/seeds/online-application-deployment-reducing-risk&quot;&gt;my thoughts on why successfully managing code deployments in an online architecture is so radically different from release management in a traditional software engineering endeavor&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;
Perhaps most challenging is the pace at which competition moves. In the online world, I can have an idea this morning, an implementation this afternoon and every client of my service that shows up tomorrow will see it. In fact, things can and do happen much faster than that. You might think that rapid concept-to-availability push is reckless. You might be right. But, your competition is doing it.
&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;http://omniti.com/seeds/online-application-deployment-reducing-risk&quot;&gt;Read more&lt;/a&gt;.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 18 Mar 2010 14:07:13 -0400</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/175</guid>
    
</item>
<item>
    <title>Squeezing precise numbers into fixed width types... or faking it</title>
    <link>http://lethargy.org/~jesus/writes/squeezing-precise-numbers-into-fixed-width-types-or-faking-it</link>
            <category>OpenSolaris</category>
            <category>PostgreSQL</category>
    
    <comments>http://lethargy.org/~jesus/writes/squeezing-precise-numbers-into-fixed-width-types-or-faking-it#comments</comments>
    <wfw:comment>http://lethargy.org/~jesus/wfwcomment.php?cid=174</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lethargy.org/~jesus/rss.php?version=2.0&amp;type=comments&amp;cid=174</wfw:commentRss>
    

    <author>nospam@example.com (Theo Schlossnagle)</author>
    <content:encoded>
    &lt;p&gt;I have this app where we store numbers.  Don&#039;t we all?  Unfortunately, this app stores numbers without context.  So, I don&#039;t know whether the number will be an integer or represent numbers throughout the real number space.  Compounding this situation, I stand to gain particular advantage if I can store all these numbers in a fixed width datatype (each number consume the same number of bits of storage space).  On current computer systems, there are two native types to each do some of what we want: the 64bit &lt;a href=&quot;http://en.wikipedia.org/wiki/IEEE_754-2008&quot;&gt;IEEE floating point&lt;/a&gt; type &quot;double&quot; and the 64bit integer types &quot;signed/unisnged long long&quot;.  However, I don&#039;t know which datatype to use before I actually see the number for the first time.&lt;/p&gt;

&lt;p&gt;Let&#039;s take temperature as an example.  In some accepted unit like C, F or K a possible value would be something like 37.23 or 49.05 which is a non-integer value where it would seem to make sense to use a float or a double.  Round trip time in seconds is a great example of what one would think of as a perfect use for a IEEE floating point number as a float or a double.  In that format, the most significant digits are more accurate, so if you are measuring the latency between two networked system (microseconds) or you are measuring the time to run an enormous data mining operation (days) you will get something accurate.  Why is a type that looses accuracy okay here?  If your operation takes months or years to complete an operation, you don&#039;t likely care if the operation took 2 years and 37 microseconds or 2 years and 12 microseconds.  It may seem that a double would, generally speaking, be pretty good for just about anything.  Not so.&lt;/p&gt;

&lt;p&gt;In the real world, we frequently measure the number of octets (bytes) passed through switching equipment.  These numbers are typically represented in a counter that ranges in integral value between 0 and 2&lt;sup&gt;64&lt;/sup&gt;-1.  Now, if we store the number as a double, as we approach the upper end, the double starts to loose accuracy.  Here&#039;s a quick sample so you can see it.  I&#039;ll take X and X+100 as doubles and then subtract them to see the difference.  As X gets very very large, 100 is less significant (the one-hundreds place), so we start to loose accuracy.  I save you some reading by starting at 2&lt;sup&gt;48&lt;/sup&gt; as that&#039;s where the interesting things start.&lt;/p&gt;

&lt;pre&gt;
#include &lt;stdio.h&gt;
#include &lt;stdint.h&gt;
#include &lt;math.h&gt;

int main() {
  int i;
  for(i=48;i&lt;63;i++) {
    uint64_t i1 = 1;
    double d1;
    i1 &lt;&lt;= i;
    d1 = (double)(i1 + 100);
    printf(&quot;%g - %llu = 100, saw %llu (%g%%)\n&quot;,
           d1, i1, (uint64_t)d1 - i1,
           fabs((double)((uint64_t)d1 - i1)-100.0));
  }
}
&lt;/pre&gt;

&lt;p&gt;Producing the output:&lt;/p&gt;

&lt;pre&gt;
2.81475e+14 - 281474976710656 = 100, saw 100 (0%)
5.6295e+14 - 562949953421312 = 100, saw 100 (0%)
1.1259e+15 - 1125899906842624 = 100, saw 100 (0%)
2.2518e+15 - 2251799813685248 = 100, saw 100 (0%)
4.5036e+15 - 4503599627370496 = 100, saw 100 (0%)
9.0072e+15 - 9007199254740992 = 100, saw 100 (0%)
1.80144e+16 - 18014398509481984 = 100, saw 100 (0%)
3.60288e+16 - 36028797018963968 = 100, saw 96 (4%)
7.20576e+16 - 72057594037927936 = 100, saw 96 (4%)
1.44115e+17 - 144115188075855872 = 100, saw 96 (4%)
2.8823e+17 - 288230376151711744 = 100, saw 128 (28%)
5.76461e+17 - 576460752303423488 = 100, saw 128 (28%)
1.15292e+18 - 1152921504606846976 = 100, saw 0 (100%)
2.30584e+18 - 2305843009213693952 = 100, saw 0 (100%)
4.61169e+18 - 4611686018427387904 = 100, saw 0 (100%)
&lt;/pre&gt;

&lt;p&gt;You might ask, why the one-hundreds place is important in numbers that are this large.  The answer is very simple.  This measures octets through a switch, think of milliliters of water from a faucet.  After you&#039;ve used the faucet a long time, that number is staggering.  However, if I want to know liters/second over the last 5 seconds it is very likely that the two samples I take (now and five seconds from now) will be both enormous and relatively close.  And while the accuracy of difference matters, it is too insignificant to be represented in the IEEE floating point format.  The interesting thing is, the source never reports anything but integral values, so if we were simply using an integral datatype we would have exactness.&lt;/p&gt;

&lt;p&gt;So, what do you do when you don&#039;t know?  Arbitrary precision math, or in SQL: numeric.  Numerics are great because you always get the correct answer.  Numerics are bad because computers are not very good at doing math outside of the IEEE floating point and integral spaces; in other words, it&#039;s painfully slow.  Perhaps worse than being slow, the numeric datatype is a variable width type, which in this case means I&#039;ve lost the battle.&lt;/p&gt;

&lt;p&gt;Now back to my app: the inputs are either floating point numbers or integral numbers, but the only way we can tell is if they contain a decimal point when expressed in non-scientific notation; or, do they have any non-zero values in places to the right of the one&#039;s place?  What we want to do is give accurate integral storage to apps that are courteous enough to provide integral numbers in the range of -2&lt;sup&gt;63&lt;/sup&gt; to 2&lt;sup&gt;64&lt;/sup&gt;-1 and use a double otherwise.  This allows us to use 64bits of fixed space to store the value (though we need some extra bits to note that the 64bits represents a double vs. a signed integer vs. an unsigned integer).  Once we&#039;ve tackled this, we can accept numeric values from SQL stored them in fixed size (with expected loss of insignificant places for floating point and expected accuracy for integral values) and return them back as numerics.&lt;/p&gt;

&lt;p&gt;My little project fronts against &lt;a href=&quot;http://postgresql.org&quot;&gt;PostgreSQL&lt;/a&gt;, so I had to convert integers and doubles into numerics.  Much to my surprise, the internal method of converting this is to convert from type1 to a string and then from a string to type2.  This is a very inefficient process.  It turns out that &lt;a href=&quot;https://labs.omniti.com/pgsoltools/trunk/contrib/scratch/pg_type_to_numeric.c&quot;&gt;direct double to numeric conversion&lt;/a&gt; (as expected) is much faster.  In our case it shaves off approximately 50% of the CPU cycles.&lt;/p&gt;

&lt;p&gt;As a disclaimer, this is a very special purposed storage type and neither replaces the double, integer or numeric type.  It is, instead, a hybrid type with special properties that are attuned to the problem at hand.  Before you go implementing something similar, make sure you know what you are doing.  Our goals were to retain accuracy for integral types, achieve a fixed-width storage format and still allow representation of numbers both large and arbitrarily smaller than 1.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 05 Mar 2010 09:13:56 -0500</pubDate>
    <guid isPermaLink="false">http://lethargy.org/~jesus/writes/174</guid>
    
</item>

</channel>
</rss>