<?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>Big Dave's Blog</title>
	<atom:link href="http://davedupre.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://davedupre.com</link>
	<description>Some random thoughts - Go big or stay home!</description>
	<pubDate>Thu, 24 Jul 2008 17:43:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>&#8216;Neglect&#8217; of Bletchley condemned</title>
		<link>http://davedupre.com/2008/07/24/neglect-of-bletchley-condemned/</link>
		<comments>http://davedupre.com/2008/07/24/neglect-of-bletchley-condemned/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 17:43:48 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://davedupre.com/?p=89</guid>
		<description><![CDATA[BBC NEWS &#124; Technology &#124; &#8216;Neglect&#8217; of Bletchley condemned
I came across this interesting article regarding Blechley Park.  I was surprised to see how rundown the place is.  For those that don&#8217;t know, Bletchley Park is where the code breakers lived during WWII.  It is basically the birthplace of modern computing, and it helped shortened the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://news.bbc.co.uk/1/hi/technology/7517874.stm">BBC NEWS | Technology | &#8216;Neglect&#8217; of Bletchley condemned</a></p>
<p>I came across this interesting article regarding <a href="http://en.wikipedia.org/wiki/Bletchley_Park">Blechley Park</a>.  I was surprised to see how rundown the place is.  For those that don&#8217;t know, <a href="http://www.bletchleypark.org.uk/">Bletchley Park</a> is where the code breakers lived during WWII.  It is basically the birthplace of modern computing, and it helped shortened the war.  Imagine reading your enemy&#8217;s mail.  Unfortunately, even though they knew certain things, the Alies often had to ignore it or risk letting the enemy know their secrets were not safe. Overall, however, the knowledge had a huge impact on the war.</p>
<p>I know the soldiers deserve credit for everything they fought and died for (believe me. I know.), but show a little love for those geeks that worked hard in total secrecy doing their part to secure victory.  They may not have carried a gun, but their information saved thousands and had a huge impact on the Alied victory.  It wasn&#8217;t till the 1970s that the place was even acknowledged to exist and the thousands of workers could talk about it publicly.</p>
<p>Bletchley Park needs to preserved both for its place in modern history and for its place in modern computing.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2008/07/24/neglect-of-bletchley-condemned/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Posting from an iPhone</title>
		<link>http://davedupre.com/2008/07/23/posting-from-an-iphone/</link>
		<comments>http://davedupre.com/2008/07/23/posting-from-an-iphone/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 13:25:13 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://davedupre.com/2008/07/23/posting-from-an-iphone/</guid>
		<description><![CDATA[I&#8217;ve been away for awhile juggling several things. I did find the time to replace my old Blackberry with an iPhone 3G. Very nice!
Of course, I had to try my first blog post using the new Wordpress for iPhone app. It works well. 
I have a bunch of new material that I will be posting [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been away for awhile juggling several things. I did find the time to replace my old Blackberry with an iPhone 3G. Very nice!</p>
<p>Of course, I had to try my first blog post using the new Wordpress for iPhone app. It works well. </p>
<p>I have a bunch of new material that I will be posting over the next few weeks.</p>
<p>Right now, it&#8217;s time to find more fun stuff on this device.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2008/07/23/posting-from-an-iphone/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Measuring Performance and Cost Value Index</title>
		<link>http://davedupre.com/2008/05/09/measuring-performance-and-cost-value-index/</link>
		<comments>http://davedupre.com/2008/05/09/measuring-performance-and-cost-value-index/#comments</comments>
		<pubDate>Fri, 09 May 2008 13:18:16 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://davedupre.com/2008/05/09/measuring-performance-and-cost-value-index/</guid>
		<description><![CDATA[I often ask the question &#8220;How can we properly work out pay for performance?&#8221;  For some teams it sounds pretty simple.  Sales, for instance, has some relatively simple metrics.  How many encounters? How much did you sell?  It&#8217;s a little more difficult for Engineering.  Here&#8217;s an example that I often [...]]]></description>
			<content:encoded><![CDATA[<p>I often ask the question &#8220;How can we properly work out pay for performance?&#8221;  For some teams it sounds pretty simple.  Sales, for instance, has some relatively simple metrics.  How many encounters? How much did you sell?  It&#8217;s a little more difficult for Engineering.  Here&#8217;s an example that I often see:</p>
<p>A great product team gets together and builds an amazing product or service.  Product Marketing provided valuable customer feedback.  Product Design uses that feedback to designed a great product that removes customer pain.  Development builds it on-time and under budget, and QA ensures a high-quality product. All of these teams work together to build an awesome product &#8212; often with long hours and a few miracles along the way. As a result of these efforts, sales go through the roof.  Unfortunately, all that means is Sales gets the most benefit (monetarily anyway) from the the other teams efforts because their commissions go up.</p>
<p>The question is how does this work it&#8217;s way back to the other teams? Should it? Unfortunately, there is no easy answer because there isn&#8217;t any way to figure out how much an individual contributed to a product.  At first, I thought we could come up with a scheme to reward a <em>team</em> for their contributions, but even that doesn&#8217;t always work. In the world of Agile and Scrum, there is a concept of BVI (Business Value Index).  I often use BVI to help prioritize stories for completion.  In a nutshell, BVI is the percentage contribution a story has to the overall value of the release. So, if a release is projected to bring in $1M in revenue, and a story has a BVI of 0.25, then that story&#8217;s Business Value (BV) is $250K.  In theory, you could then use the combined BV of a scrum team&#8217;s story output to come up with that team&#8217;s contribution to the final value.  Unfortunately, the reality is not that simple.  Often, stories have a BVI of 0 even though other stories can&#8217;t happen without it.  A story to refactor a class to make it more maintainable has no impact on the customer and, therefore, no BVI.  It does impact cost, so maybe we could add a CVI (Cost Value Index) to those stories without BVI.</p>
<p>To some extent, CVI can have even more impact long term.  A story with a BV of $250K will always be far less on the company&#8217;s bottom line.  However, a story with a Cost Value (CV) of $250K goes straight to the company bottom line.  Plus, developer&#8217;s spend less time on maintenance and more time developing, and that makes everyone happy.</p>
<p>Cost Value sounds like a great idea, but it is extremely difficult to calculate. In fact, very few organizations pay much attention to it.   &#8220;We can&#8217;t spend 80 hours automating that process. There isn&#8217;t time.&#8221;  The part that people forget is not having the process automated is costing 10 hours per week.  Let&#8217;s say one developer takes the two weeks (80 hours) to automated it, then your total cost is 100 hours (you still have the 10 hours/week without automation).  For your 100 hours of cost, you saved 480 hours over a year (48 weeks * 10 hours/week).  That&#8217;s 480 more hours to spend on actual product development.</p>
<p>CV = Net savings per year<br />
CVI = Percentage contribution to the whole</p>
<p>I need to think about this some more, but I&#8217;m curious what people think. The biggest problem with this is a breaks one fundamental rule in Scrum. That is to properly calculate CV, you have to track how much time people are spending not doing their tasks, and we know we should only be tracking how much time is left.</p>
<p>What do you think?  I don&#8217;t like the idea of tracking time, but I do like the idea of being able to prioritize a story that reduces costs along with a story that generates revenue.</p>
<p>I will leave you with a great quote. I don&#8217;t know who said it, but it is so very true.</p>
<p>&#8220;Organizations don&#8217;t get what they want. They get what they measure.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2008/05/09/measuring-performance-and-cost-value-index/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Patent Decisions Since 2000 Invalid?</title>
		<link>http://davedupre.com/2008/05/06/patent-decisions-since-2000-invalid/</link>
		<comments>http://davedupre.com/2008/05/06/patent-decisions-since-2000-invalid/#comments</comments>
		<pubDate>Tue, 06 May 2008 20:26:53 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://davedupre.com/2008/05/06/patent-decisions-since-2000-invalid/</guid>
		<description><![CDATA[Anyone see the NY Times article In One Flaw, Questions on Validity of 46 Judges? Basically, a law professor discovered a constitutional flaw in the appointment process for judges who decide patent appeals and disputes.  This goes back to 2000.  That means thousands of patent cases and billions of dollars in licenses.  The really interesting [...]]]></description>
			<content:encoded><![CDATA[<p>Anyone see the NY Times article <a href="http://www.nytimes.com/2008/05/06/washington/06bar.html?ei=5070&amp;en=8e768f74662c4adb&amp;ex=1210737600&amp;adxnnl=1&amp;emc=eta1&amp;adxnnlx=1210104651-iWi2yE0qnu83HoFRXQLjuw"><em>In One Flaw, Questions on Validity of 46 Judges</em></a>? Basically, a law professor discovered a constitutional flaw in the appointment process for judges who decide patent appeals and disputes.  This goes back to 2000.  That means thousands of patent cases and billions of dollars in licenses.  The really interesting part is that no one, including the patent office, is saying he is wrong.</p>
<p>Imagine all those startups thinking they are secure with a patent to cover their IP. This is one crazy cloud over so that thought. Granted, a bunch of recent patents are completely bogus, but now the patent trolls could have a field day.   Definitely need to keep an eye on this one.</p>
<p>I wonder if that means the patent I just received last month is not valid anymore&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2008/05/06/patent-decisions-since-2000-invalid/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Kelly Johnson and Agile Development</title>
		<link>http://davedupre.com/2008/04/30/kelly-johnson-and-agile-development/</link>
		<comments>http://davedupre.com/2008/04/30/kelly-johnson-and-agile-development/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 18:33:55 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://davedupre.com/2008/04/30/83/</guid>
		<description><![CDATA[In a previous post about the F-117, I described some of the rules Kelly Johnson had for his projects. As promised, here is how I would map Kelly&#8217;s rules to agile development.
Kelly: 1. The Skunk Works manager must be delegated practically complete control of his program in all aspects. He should report to a division [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://davedupre.com/2008/03/12/f-117-stealth-fighters-to-make-final-flight-and-agile-development/">previous post about the F-117</a>, I described some of the rules Kelly Johnson had for his projects. As promised, here is how I would map Kelly&#8217;s rules to agile development.</p>
<p><strong>Kelly:</strong> 1. The Skunk Works manager must be delegated practically complete control of his program in all aspects. He should report to a division president or higher.</p>
<p><strong>Agile:</strong> 1. The Scrum Master must have the power and authority to remove any blocking issues.</p>
<p><strong>Kelly:</strong> 2. Strong but small project offices must be provided both by the military and industry.</p>
<p><strong>Agile:</strong> 2. Sprint teams must be in the same offices. Virtual teams can work, but it&#8217;s best to be in the same area.</p>
<p><strong>Kelly:</strong> 3. The number of people having any connection with the project must be restricted in an almost vicious manner. Use a small number of good people (10% to 25% compared to the so-called normal systems).</p>
<p><strong>Agile:</strong> 3. Sprint teams must be small (&lt; 7). Although, I like Kelly&#8217;s phrasing better.</p>
<p><strong>Kelly:</strong> 4. A very simple drawing and drawing release system with great flexibility for making changes must be provided.</p>
<p><strong>Agile:</strong> 4. Use Stories instead of detailed design and functional specifications. Document when necessary, but keep it simple.</p>
<p><strong>Kelly:</strong> 5. There must be a minimum number of reports required, but important work must be recorded thoroughly.</p>
<p><strong>Agile:</strong> 5. Keep the status reports to the waterfall people. We hold daily Scrum Meetings to discuss status. If you&#8217;re interested, come to the meeting, but don&#8217;t expect a report.</p>
<p><strong>Kelly:</strong> 6. There must be a monthly cost review covering not only what has been spent and committed but also projected costs to the conclusion of the program. Don&#8217;t have the books ninety days late and don&#8217;t surprise the customer with sudden overruns.</p>
<p><strong>Agile:</strong> 6. Hold daily Scrum meetings to determine the status of the project. Identify and remove blocking issues before they become a problem.</p>
<p><strong>Kelly:</strong> 7. The contractor must be delegated and must assume more than normal responsibility to get good vendor bids for subcontract on the project. Commercial bid procedures are very often better than military ones.</p>
<p><strong>Agile:</strong> 7. The Sprint Team must be fully empowered to reach the Sprint Goal.</p>
<p><strong>Kelly:</strong> 8. The inspection system as currently used by the Skunk Works, which has been approved by both the Air Force and Navy, meets the intent of existing military requirements and should be used on new projects. Push more basic inspection responsibility back to subcontractors and vendors. Don&#8217;t duplicate so much inspection.</p>
<p><strong>Agile:</strong> 8. The Sprint Team shall complete all assigned stories, including full testing. Don&#8217;t push testing off for a future team.</p>
<p><strong>Kelly:</strong> 9. The contractor must be delegated the authority to test his final product in flight. He can and must test it in the initial stages. If he doesn&#8217;t, he rapidly loses his competency to design other vehicles.</p>
<p><strong>Agile:</strong> 9. The Sprint Team must demonstrate success of the Sprint by showing actual, working product that completes the assigned stories. Testing must be don&#8217;t continuously throughout the Sprint.</p>
<p><strong>Kelly:</strong> 10. The specifications applying to the hardware must be agreed to well in advance of contracting. The Skunk Works practice of having a specification section stating clearly which important military specification items will not knowingly be complied with and reasons therefore is highly recommended.</p>
<p><strong>Agile:</strong> 10. Stories must be committed to in advance of the Sprint.</p>
<p><strong>Kelly:</strong> 11. Funding a program must be timely so that the contractor doesn&#8217;t have to keep running to the bank to support government projects.</p>
<p><strong>Agile:</strong> 11. Keep the Sprint Team well fed, well caffeinated, and unblocked.</p>
<p><strong>Kelly:</strong> 12. There must be mutual trust between the military project organization and the contractor with very close cooperation and liaison on a day-to-day basis. This cuts down misunderstanding and correspondence to an absolute minimum.</p>
<p><strong>Agile:</strong> 12. There must be mutual trust between upper management and the Sprint Team. Scrum Meetings are held daily to facilitate communication.</p>
<p><strong>Kelly:</strong> 13. Access by outsiders to the project and its personnel must be strictly controlled by appropriate security measures.</p>
<p><strong>Agile:</strong> 13. Access by outsiders to the Sprint team and its personnel must be strictly controlled by the Scrum Master.  That means no going to a Sprint Team member to add more tasks.</p>
<p><strong>Kelly:</strong> 14. Because only a few people will be used in engineering and most other areas, ways must be provided to reward good performance by pay not based on the number of personnel supervised.</p>
<p><strong>Agile:</strong> 14. Pay should be based on the success of the team and the individual, not on how many people are supervised.</p>
<p>There you have it. Kelly Johnson and the Skunk Works were one of the first Agile Engineering shops. Very few can claim to be as successful or innovative.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2008/04/30/kelly-johnson-and-agile-development/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Follow up to high stakes salvage</title>
		<link>http://davedupre.com/2008/04/29/follow-up-to-high-stakes-salvage/</link>
		<comments>http://davedupre.com/2008/04/29/follow-up-to-high-stakes-salvage/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 02:04:34 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://davedupre.com/2008/04/29/follow-up-to-high-stakes-salvage/</guid>
		<description><![CDATA[A Crushing Issue: How to Destroy Brand-New Cars
Last month, I pointed out an article about salvaging a ship in trouble.  The salvage crew successfully saved the ship and its cargo of 4,703 Mazda vehicles (loosing one life in the process), but now what do you do with the cars?  Turns out, it&#8217;s not easy to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://online.wsj.com/article/SB120942873506551291.html">A Crushing Issue: How to Destroy Brand-New Cars</a></p>
<p>Last month, I pointed out an article about <a href="http://davedupre.com/2008/02/27/high-stakes-salvage-smarts-over-brawn/">salvaging a ship in trouble</a>.  The salvage crew successfully saved the ship and its cargo of 4,703 Mazda vehicles (loosing one life in the process), but now what do you do with the cars?  Turns out, it&#8217;s not easy to destroy 4,703 cars and not get in trouble, damage your brand, or get sued in the process.  It took Mazda a year to plan and about another year to actually do it.  Who knew?</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2008/04/29/follow-up-to-high-stakes-salvage/feed/</wfw:commentRss>
		</item>
		<item>
		<title>POPSignal - Boston, May 15th</title>
		<link>http://davedupre.com/2008/04/24/popsignal-boston-may-15th/</link>
		<comments>http://davedupre.com/2008/04/24/popsignal-boston-may-15th/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 19:37:01 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://davedupre.com/2008/04/24/popsignal-boston-may-15th/</guid>
		<description><![CDATA[ 
Those of you in Boston may remember Tech Cocktail last fall. If you were one of the lucky 300+ people in attendance, you know how successful it was.  I know I enjoyed it, and I met some great new contacts there.  Well, Brian Balfour and Jay Meattle are at it again, but [...]]]></description>
			<content:encoded><![CDATA[<p> <img src="http://popsignal.com/landing/images/headerlogo.gif" title="POPSignal" alt="POPSignal" height="163" width="594" /></p>
<p>Those of you in Boston may remember Tech Cocktail last fall. If you were one of the lucky 300+ people in attendance, you know how successful it was.  I know I enjoyed it, and I met some great new contacts there.  Well, <a href="http://www.socialdegree.com/">Brian Balfour</a> and <a href="http://hepguru.com/blog/">Jay Meattle</a> are at it again, but now it is <a href="http://www.popsignal.com/">POPSignal</a>.</p>
<p><a href="http://www.popsignal.com/">POPSignal</a> parties are aimed at bringing together the local tech community in a fun and informal environment. There is no format, presentations, or speeches. However, there is always a free open bar, free food, music, fun activities from sponsors, and great conversation.</p>
<p>The date is May 15th, 6:30-9:30pm, at Tequila Rain near Fenway Park. To RSVP and get more details check out <a href="http://popsignal.eventbrite.com/">http://popsignal.eventbrite.com/</a>.</p>
<p>Come on by and say hello.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2008/04/24/popsignal-boston-may-15th/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Continuing the Lockheed Skunk Works Theme</title>
		<link>http://davedupre.com/2008/04/22/continuing-the-lockheed-skunk-works-theme/</link>
		<comments>http://davedupre.com/2008/04/22/continuing-the-lockheed-skunk-works-theme/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 16:03:50 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://davedupre.com/2008/04/22/continuing-the-lockheed-skunk-works-theme/</guid>
		<description><![CDATA[The History Behind the F-35B
Continuing the theme of the Lockheed Skunk Works, this is an interesting take on the development of the shaft-driven fan on the F-35B. The inventor discusses how he came up with the idea and how the system works.  Like any good research project, there was a risk of failure, but [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://gizmodo.com/382151/the-history-behind-the-f+35b-vertical-lift-from-napkin-to-first-supersonic-plane">The History Behind the F-35B</a></p>
<p>Continuing the theme of the <a href="http://davedupre.com/2008/03/12/f-117-stealth-fighters-to-make-final-flight-and-agile-development/">Lockheed Skunk Works</a>, this is an interesting take on the development of the shaft-driven fan on the <a href="http://en.wikipedia.org/wiki/F-35_Lightning_II">F-35B</a>. The inventor discusses how he came up with the idea and how the system works.  Like any good research project, there was a <a href="http://davedupre.com/2007/05/07/fear-of-failure/">risk of failure</a>, but in the 9th month of a 9 month study Dr. Paul Bevilaqua had an idea that eventually turned into the F-35&#8217;s engine. I hope he got a bonus considering the F-35 contract is worth $200 Billion (that&#8217;s a &#8216;B&#8217;).</p>
<p>One comment from Dr. Bevilaqua worth mentioning is how it is more important to do engineering than to do math. In other words, think!  As Dr. Bevilaqua says, school may have taught him how to move the pieces, but his mentor (<a href="http://en.wikipedia.org/wiki/Hans_von_Ohain">Dr. Hans von Ohain</a>, co-inventor of the jet engine) taught him how to play chess.  In my travels, I see far too many &#8220;engineers&#8221; that don&#8217;t think. If someone hasn&#8217;t done it before, they are stuck.</p>
<p>We all should take a lesson from this. Good software engineering is more than re-hashing what someone else did. Sometimes it&#8217;s the wacky ideas that end up being the best. Don&#8217;t be afraid to reach sometimes and see what might work. Don&#8217;t re-invent the wheel, but if there is no wheel then figure out a way to make one.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2008/04/22/continuing-the-lockheed-skunk-works-theme/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ruby Background Tasks with Starling - Part 3</title>
		<link>http://davedupre.com/2008/04/01/ruby-background-tasks-with-starling-part-3/</link>
		<comments>http://davedupre.com/2008/04/01/ruby-background-tasks-with-starling-part-3/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 14:39:32 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://davedupre.com/2008/04/01/ruby-background-tasks-with-starling-part-3/</guid>
		<description><![CDATA[In my previous post, I went over the changes I made to Workling to add threading and allow it to run for long periods. Now, we need to deploy and monitor everything.  In the Linux word, there are several options, but monit seems to be the most popular.  However, I wanted to give [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://davedupre.com/2008/03/29/ruby-background-tasks-with-starling-part-2/">previous post</a>, I went over the changes I made to Workling to add threading and allow it to run for long periods. Now, we need to deploy and monitor everything.  In the Linux word, there are several options, but <a href="http://www.tildeslash.com/monit/">monit</a> seems to be the most popular.  However, I wanted to give <a href="http://god.rubyforge.org/">god.rb</a> a shot. God.rb is basically a clone of monit written in Ruby. What it&#8217;s written in doesn&#8217;t really matter to me, but setting up my config files in Ruby was interesting.  That&#8217;s one more set of script commands I don&#8217;t have know.</p>
<p>Installing god.rb is as simple as:</p>
<p>sudo gem install god</p>
<p>The <a href="http://god.rubyforge.org/">god.rb</a> web site has some decent documentation to help you understand how to build a config file.  I tend to build my config files for as much as I can using erb templates rather than manually updating the config files for each environment.  I build my apache config file this way as well.</p>
<p>1. Download <a href="http://davedupre.com/wp-content/uploads/2008/04/godconf.txt" title="my god config">my god config</a> to /lib/templates/god.conf.  This is an example of an actual god.conf file.  You will want to update it for paths and to setup the mongrels and the listeners to not run as root &#8212; not a good idea to run those as root. My apache and mysql scripts already run as a different user.</p>
<p>2. Now, add the following to your config/deploy.rb file:</p>
<pre><code>
namespace :god do

  desc &lt;&lt;-DESC
  Generate the GOD configuration. We will create the appropriate GOD
  configuration stanza for the application and copy it to:

  /shared/path/god.conf

  Once it's there, somebody with the required permission to manage the
  GOD configuration should somehow incorporate that file and restart
  the GOD server. Each time the runtime configuration (ie number of
  mongrels running) changes, the configuration will have to be manually
  updated to match.
  DESC
  task :config, :roles =&gt; :app do
    rails_env = fetch(:rails_env, 'production')
    dispatcher_starting_port = fetch(:dispatcher_starting_port, 8000)
    dispatcher_instances = fetch(:dispatcher_instances, 3)
    dispatcher_ending_port = dispatcher_starting_port + dispatcher_instances - 1
    dispatcher_ports = dispatcher_starting_port..dispatcher_ending_port
    god_conf_path = "#{shared_path}/god.conf"
    god_conf_template = File.join(File.dirname(__FILE__), '..', 'lib', 'templates', 'god.conf.erb')
    begin
      god_conf = ERB.new(File.read(god_conf_template)).result(binding)
      put god_conf, god_conf_path, :mode =&gt; 0644
    rescue Exception =&gt; e
      abort "An error occurred in the GOD config generation: #{e}"
    end
  end
end
</code></pre>
<p>3. Execute cap god:config with the desired environment, and a new god.conf file will be copied to the shared directory on your server.  I&#8217;m assuming you have capistrano 2.x here.</p>
<p>4. On your server, execute: sudo god -c /shared/path/god.conf</p>
<p>That&#8217;s it!  Now, all your processes will be monitored by god.rb and restarted whenever there is a problem.  Hold on though, we&#8217;re not completely done.  You want god.rb to start up when your server boots, right? We also have to update our deploy process to use god.rb to start/stop our services now. Try to use you existing spin or spawn tasks, and god.rb will fight with you.</p>
<p>First, let&#8217;s get god.rb setup as a service.  I found this script in the god.rb sources, and I tweaked it a bit for my system.</p>
<pre><code>
#!/bin/bash
# god       startup script for god (like monit, only Ruby)
# Author: Dave Dupre

# Comments to support chkconfig on CentOS
# chkconfig: - 85 15
# description: god - monitor all my processes

CONF_DIR=/shared/path
LOG_DIR=/var/log
PID_DIR=/var/run/god
BIN_DIR=/usr/local/bin

RETVAL=0

# Go no further if config directory is missing.
[ -d "$CONF_DIR" ] || exit 0

case &#8220;$1&#8243; in
  start)
    $BIN_DIR/god -P $PID_DIR/god.pid -l $LOG_DIR/god.log -c $CONF_DIR/god.conf
    RETVAL=$?
  ;;
  stop)
    $BIN_DIR/god terminate
    RETVAL=$?
  ;;
  restart)
    $BIN_DIR/god terminate
    $BIN_DIR/god -P $PID_DIR/god.pid -l $LOG_DIR/god.log -c $CONF_DIR/god.conf
    RETVAL=$?
  ;;
  status)
    $BIN_DIR/god status
    RETVAL=$?
  ;;
  *)
  echo &#8220;Usage: god {start|stop|restartstatus}&#8221;
  exit 1
  ;;
esac

exit $RETVAL
</code></pre>
<p>Put the above contents into /etc/init.d/god and make it executable (sudo chmod +x /etc/init.d/god).  Lastly, tell your system there is a new service in town. I use CentOS 5, so I run:</p>
<p>sudo chkconfig /etc/init.d/god on</p>
<p>Now, god.rb will start up whenever your server boots, and you can start/stop/restart it using standard service calls.</p>
<p>The last thing we need to do is update our deployment process to use god.rb to stop/start our processes.   Add this to your deploy.rb file:</p>
<pre><code>
namespace :deploy do
  [ :stop, :start, :restart ].each do |t|
    desc &#8220;#{t.to_s.capitalize} mongrels using god&#8221;
    task t, :roles =&gt; :app do
      sudo &#8220;god #{t.to_s} listeners&#8221;
      sudo &#8220;god #{t.to_s} mongrels&#8221;
    end
  end
end

namespace :starling do
  [ :stop, :start, :restart ].each do |t|
    desc &#8220;#{t.to_s.capitalize} starling using god&#8221;
    task t, :roles =&gt; :app do
      sudo &#8220;god #{t.to_s} starlings&#8221;
    end
  end
end

namespace :workling do
  [ :stop, :start, :restart ].each do |t|
    desc &#8220;#{t.to_s.capitalize} workling using god&#8221;
    task t, :roles =&gt; :app do
      sudo &#8220;god #{t.to_s} listeners&#8221;
    end
  end
end
</code></pre>
<p>OK! Now, we&#8217;re done. You deploy as you normally would, and I have full control over Starling and the Workling listener. Notice that there is no mongrel cluster either. God.rb started up all the instances of mongrel I needed, and it will monitor everything so there is no need for mongrel cluster anymore.</p>
<p>That&#8217;s it for now. You have a system that will process all your background tasks and stay running. The only thing I didn&#8217;t setup here is notifications from god.rb when there is a problem. The god.rb config settings have lots of schemes for email notifications. Take a peak at the docs and make sure god can talk to you.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2008/04/01/ruby-background-tasks-with-starling-part-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ruby Background Tasks with Starling - Part 2</title>
		<link>http://davedupre.com/2008/03/29/ruby-background-tasks-with-starling-part-2/</link>
		<comments>http://davedupre.com/2008/03/29/ruby-background-tasks-with-starling-part-2/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 20:08:10 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://davedupre.com/2008/03/29/ruby-background-tasks-with-starling-part-2/</guid>
		<description><![CDATA[In my previous post, I briefly described how simple it is to add background processing to your RoR app with Starling and the Workling plugin. Now, let&#8217;s discuss the changes I made to the Workling plugin, and then get everything deployed and monitored. As good as the Workling plugin is, it had one limitation that [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous <a href="http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/">post</a>, I briefly described how simple it is to add background processing to your RoR app with <a href="http://rubyforge.org/projects/starling/">Starling</a> and the <a href="http://playtype.net/past/2008/2/6/starling_and_asynchrous_tasks_in_ruby_on_rails/">Workling</a> plugin. Now, let&#8217;s discuss the changes I made to the Workling plugin, and then get everything deployed and monitored. As good as the Workling plugin is, it had one limitation that hurt me. At <a href="http://inquisix.com">Inquisix</a>, I have 5 workers to handle importing contacts, stats/logging, emails, searching, etc. Most methods are pretty quick, but a large import process could take 5-10 minutes to complete. With the original Workling, that meant all my other background tasks would wait, and I didn&#8217;t want that. The easiest solution for me was to modify Workling so each worker polled its queues in a thread. That way, if the contact worker was busy importing 1000 contacts, my emails still got delivered in a reasonable amount of time.</p>
<p>Most of the changes to Workling, are limited to the lib/workling/starling/poller.rb file.  Here is a summary of the changes I made:</p>
<ul>
<li>Added threading</li>
<li>Updated the way ClassAndMethodRouting builds the routing hash. I needed a routing hash per worker. Note, whatever you do don&#8217;t ever try to call routing.build from inside another thread. Really strange things happen that were very difficult to track down. Ruby threads are nice, but I&#8217;m used to real threads.</li>
<li>Added handling for MemCache exceptions. During development, I went to dinner and left the listener running without Starling. When I got back, my Mac was complaining the disk was full because my log was &gt; 40Gig. Now, I explicitly catch MemCache exceptions and wait 30 seconds before trying again. The log will still grow, but at least not as fast. Besides, I will show you how to make sure Starling stays running.</li>
<li>Keep your database connection alive. I found this out after leaving for the night. I thought I had a working system when I left, but nothing worked in the morning. Basically, ActiveRecord will drop your connection if you don&#8217;t do anything for a while. Normally, this is not a problem in web apps because the connection is updated every time you access a page, but it doesn&#8217;t work that way here. You have to do it yourself.  Add this in your loop to be sure:
<pre><code>

unless ActiveRecord::Base.connection.active?

  unless ActiveRecord::Base.connection.reconnect!

    RAILS_DEFAULT_LOGGER.fatal("FAILED - Database not available")

    break

  end

end

</code></pre>
</li>
</ul>
<p>Here is my <a href="http://davedupre.com/wp-content/uploads/2008/06/workling.zip">workling</a> patch. Now, I need to go back and update the tests, but the threads complicate that. It&#8217;s a learning experience&#8230;</p>
<p>That&#8217;s it for now. Next time, I will walk through the deployment and monitoring process as I have it.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2008/03/29/ruby-background-tasks-with-starling-part-2/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
