<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>magpiebrain</title>
	<atom:link href="https://blog.magpiebrain.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.magpiebrain.com</link>
	<description>Sam Newman&#039;s site, a Consultant at ThoughtWorks</description>
	<lastBuildDate>Sun, 23 Sep 2012 16:56:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<site xmlns="com-wordpress:feed-additions:1">39288093</site><cloud domain='blog.magpiebrain.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://s0.wp.com/i/buttonw-com.png</url>
		<title>magpiebrain</title>
		<link>https://blog.magpiebrain.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://blog.magpiebrain.com/osd.xml" title="magpiebrain" />
	<atom:link rel='hub' href='https://blog.magpiebrain.com/?pushpress=hub'/>
	<item>
		<title>Speaking at Goto: Aarhus 2012 Next Week</title>
		<link>https://blog.magpiebrain.com/2012/09/23/speaking-at-goto-aarhus-2012-next-week/</link>
					<comments>https://blog.magpiebrain.com/2012/09/23/speaking-at-goto-aarhus-2012-next-week/#respond</comments>
		
		<dc:creator><![CDATA[samnewman]]></dc:creator>
		<pubDate>Sun, 23 Sep 2012 12:08:08 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[talks]]></category>
		<guid isPermaLink="false">http://blog.magpiebrain.com/?p=1275</guid>

					<description><![CDATA[A week from today, Jez Humble and I will be joint presenting a 1 day Continuous Delivery tutorial at one&#8230;]]></description>
										<content:encoded><![CDATA[<p>A week from today, Jez Humble and I will be joint presenting a 1 day <a href="https://blog.magpiebrain.com/2012/08/11/tutorial-continuous-delivery/">Continuous Delivery tutorial</a> at one of my favourite conferences, <a href="http://gotocon.com/aarhus-2012/">Goto: Aarhus</a>. I&#8217;m also fortunate enough to have been asked to present my <a href="https://blog.magpiebrain.com/2012/08/12/talk-designing-for-rapid-release/">Designing For Rapid Release</a> talk on Mike Nyygard&#8217;s track on <a href="http://gotocon.com/aarhus-2012/schedule/tuesday.jsp">Tuesday</a>.</p>
<p>Goto: Aarhus is an excellent conference, and tickets may still be available if you can make it. If you do, make sure you use the code newm1000 so you can save <strong>DKK 1.000 (approx £115 / €135 / $180). </strong>I hope to see you there!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.magpiebrain.com/2012/09/23/speaking-at-goto-aarhus-2012-next-week/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1275</post-id>
		<media:content url="https://2.gravatar.com/avatar/83551d215a052d33a92f6f18374d0c4cc32285f08f0e070ed8fb6bdcc00c85ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">samnewman</media:title>
		</media:content>
	</item>
		<item>
		<title>Designing For Rapid Release &#8211; GeeCon 2012 Video Now available</title>
		<link>https://blog.magpiebrain.com/2012/08/17/designing-for-rapid-release-geecon-2012-video-now-available/</link>
					<comments>https://blog.magpiebrain.com/2012/08/17/designing-for-rapid-release-geecon-2012-video-now-available/#respond</comments>
		
		<dc:creator><![CDATA[samnewman]]></dc:creator>
		<pubDate>Fri, 17 Aug 2012 09:49:12 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://blog.magpiebrain.com/?p=1262</guid>

					<description><![CDATA[The video of my Designing For Rapid Release talk that I did at GeeCon is now available. Thanks to Lukasz&#8230;]]></description>
										<content:encoded><![CDATA[<p>The video of my Designing For Rapid Release talk that I did at GeeCon is <a href="http://vimeo.com/47515968">now available</a>. Thanks to Lukasz and the rest of the <a href="http://2012.geecon.org/">GeeCon 2012</a> team for a really memorable conference &#8211; I&#8217;m already looking forward to GeeCon 2013!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.magpiebrain.com/2012/08/17/designing-for-rapid-release-geecon-2012-video-now-available/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1262</post-id>
		<media:content url="https://2.gravatar.com/avatar/83551d215a052d33a92f6f18374d0c4cc32285f08f0e070ed8fb6bdcc00c85ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">samnewman</media:title>
		</media:content>
	</item>
		<item>
		<title>Tutorial: An Introduction To AWS</title>
		<link>https://blog.magpiebrain.com/2012/08/12/tutorial-an-introduction-to-aws/</link>
					<comments>https://blog.magpiebrain.com/2012/08/12/tutorial-an-introduction-to-aws/#respond</comments>
		
		<dc:creator><![CDATA[samnewman]]></dc:creator>
		<pubDate>Sun, 12 Aug 2012 17:21:40 +0000</pubDate>
				<category><![CDATA[AWS]]></category>
		<guid isPermaLink="false">http://magpiebraindotcom.wordpress.com/?p=1201</guid>

					<description><![CDATA[For over a year now I have been running day-long training sessions on AWS with ThoughtWorks. I have helped rollout&#8230;]]></description>
										<content:encoded><![CDATA[<p>For over a year now I have been running day-long training sessions on AWS with ThoughtWorks. I have helped rollout this training globally, giving sessions in both Australia and the USA. The course covers the main building blocks of the AWS offering, including:</p>
<ul>
<li>EC2</li>
<li>EBS</li>
<li>S3</li>
</ul>
<p>A mix of theory and hands-on sections, it is ideal for anyone interested in getting started with AWS. Attendees need only a basic knowledge of a command-line, although any *NIX experience is a bonus.</p>
<p>I have presented this course multiple times for public and private classes. We are currently <a href="http://www.thoughtworks.com/events/aws-training-course">offering this course</a> in several locations &#8211; if you are interested in this course for a private occasion or conference then please <a href="/contact">contact me</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.magpiebrain.com/2012/08/12/tutorial-an-introduction-to-aws/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1201</post-id>
		<media:thumbnail url="https://blog.magpiebrain.com/wp-content/uploads/2011/07/awspostcardnotext.jpg" />
		<media:content url="https://blog.magpiebrain.com/wp-content/uploads/2011/07/awspostcardnotext.jpg" medium="image">
			<media:title type="html">AWSPostcardnotext</media:title>
		</media:content>

		<media:content url="https://2.gravatar.com/avatar/83551d215a052d33a92f6f18374d0c4cc32285f08f0e070ed8fb6bdcc00c85ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">samnewman</media:title>
		</media:content>
	</item>
		<item>
		<title>Talk: Push The Button &#8211; A View On Continuous Delivery</title>
		<link>https://blog.magpiebrain.com/2012/08/11/talk-push-the-button-a-view-on-continuous-delivery/</link>
					<comments>https://blog.magpiebrain.com/2012/08/11/talk-push-the-button-a-view-on-continuous-delivery/#respond</comments>
		
		<dc:creator><![CDATA[samnewman]]></dc:creator>
		<pubDate>Sat, 11 Aug 2012 17:24:46 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://magpiebraindotcom.wordpress.com/?p=1209</guid>

					<description><![CDATA[This talk focuses on the drivers behind, and the main advantages of Continuous Delivery. Focused at a higher level than&#8230;]]></description>
										<content:encoded><![CDATA[<p>This talk focuses on the drivers behind, and the main advantages of Continuous Delivery. Focused at a higher level than some of my other talks, it should appeal to both a technical and business audience.</p>
<p>You can view a video of the presentation I gave at one of the <a title="ThoughtWorks QTB including full video of the presentation" href="http://www.thoughtworks.com/continuous-delivery/events/push-the-button">ThoughtWorks QTB</a> events in 2011.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.magpiebrain.com/2012/08/11/talk-push-the-button-a-view-on-continuous-delivery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1209</post-id>
		<media:thumbnail url="https://blog.magpiebrain.com/wp-content/uploads/2011/07/screen-shot-2011-07-10-at-10-42-02.png" />
		<media:content url="https://blog.magpiebrain.com/wp-content/uploads/2011/07/screen-shot-2011-07-10-at-10-42-02.png" medium="image">
			<media:title type="html">Push The Button</media:title>
		</media:content>

		<media:content url="https://2.gravatar.com/avatar/83551d215a052d33a92f6f18374d0c4cc32285f08f0e070ed8fb6bdcc00c85ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">samnewman</media:title>
		</media:content>
	</item>
		<item>
		<title>The Empty Frame</title>
		<link>https://blog.magpiebrain.com/2012/05/13/the-empty-frame/</link>
					<comments>https://blog.magpiebrain.com/2012/05/13/the-empty-frame/#respond</comments>
		
		<dc:creator><![CDATA[samnewman]]></dc:creator>
		<pubDate>Sun, 13 May 2012 17:07:21 +0000</pubDate>
				<category><![CDATA[Photography]]></category>
		<guid isPermaLink="false">http://www.magpiebrain.com/?p=1137</guid>

					<description><![CDATA[I was out shooting today, putting the x-pro through its paces. No real purpose &#8211; meandering around the Portobello Road,&#8230;]]></description>
										<content:encoded><![CDATA[<p>I was out shooting today, putting the x-pro through its paces. No real purpose &#8211; meandering around the Portobello Road, shooting stall keepers and tourists alike. I turn for home, walking alongside the westway, when a cyclist zips past. I see him, heading towards me, bring the camera up, track him and *click*. Enough time for one shot, and it&#8217;s perfect. He is captured on the top right, pin sharp, looking straight into the lens. The background is beautifully blurred. Perfect shot.</p>
<p>I walk on, and get a tap on my shoulder. I turn around to see the cyclist.</p>
<p>&#8220;Can you delete that, please?&#8221;.</p>
<p>And I do.</p>
<p>Walking back, I think idly &#8220;I could probably recover that&#8230;&#8221;. Legally, I&#8217;ve done nothing wrong. And it is a great shot &#8211; one of the best I think I&#8217;ve taken. But I sigh, and know I won&#8217;t. At least this is one shot I can&#8217;t claim to have lost due to the Fuji x-pro&#8217;s AF.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.magpiebrain.com/2012/05/13/the-empty-frame/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1137</post-id>
		<media:content url="https://2.gravatar.com/avatar/83551d215a052d33a92f6f18374d0c4cc32285f08f0e070ed8fb6bdcc00c85ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">samnewman</media:title>
		</media:content>
	</item>
		<item>
		<title>lein-gentags: Generate TAGS file for your Clojure code</title>
		<link>https://blog.magpiebrain.com/2012/02/26/lein-gentags-generate-tags-file-for-your-clojure-code/</link>
					<comments>https://blog.magpiebrain.com/2012/02/26/lein-gentags-generate-tags-file-for-your-clojure-code/#respond</comments>
		
		<dc:creator><![CDATA[samnewman]]></dc:creator>
		<pubDate>Sun, 26 Feb 2012 20:45:16 +0000</pubDate>
				<category><![CDATA[clojure]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[leiningen]]></category>
		<category><![CDATA[opensource]]></category>
		<guid isPermaLink="false">http://www.magpiebrain.com/?p=1134</guid>

					<description><![CDATA[Some yak shaving while playing around with Riemann resulted in me creating my first leiningen plugin, lein-gentags. It uses etags&#8230;]]></description>
										<content:encoded><![CDATA[<p>Some yak shaving while playing around with Riemann resulted in me creating my first leiningen plugin, <a href="https://github.com/snewman/lein-gentags">lein-gentags</a>. It uses etags based on instructions from Nurullah Akkaya&#8217;s <a href="http://nakkaya.com/2009/12/13/getting-etags-to-index-clojure-files/">original blogpost</a> &#8211; perfect for improving navigation of Clojure code in Emacs. Feedback appreciated!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.magpiebrain.com/2012/02/26/lein-gentags-generate-tags-file-for-your-clojure-code/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1134</post-id>
		<media:content url="https://2.gravatar.com/avatar/83551d215a052d33a92f6f18374d0c4cc32285f08f0e070ed8fb6bdcc00c85ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">samnewman</media:title>
		</media:content>
	</item>
		<item>
		<title>New Talk: Designing For Rapid Release</title>
		<link>https://blog.magpiebrain.com/2012/01/14/new-talk-designing-for-rapid-release/</link>
					<comments>https://blog.magpiebrain.com/2012/01/14/new-talk-designing-for-rapid-release/#respond</comments>
		
		<dc:creator><![CDATA[samnewman]]></dc:creator>
		<pubDate>Sat, 14 Jan 2012 18:23:48 +0000</pubDate>
				<category><![CDATA[Build And Deployment]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[presentations]]></category>
		<guid isPermaLink="false">http://www.magpiebrain.com/?p=1129</guid>

					<description><![CDATA[I&#8217;ll be running my new talk &#8220;Designing For Rapid Release&#8221; at a couple of conferences in the first half of&#8230;]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ll be running my new talk &#8220;Designing For Rapid Release&#8221; at a couple of conferences in the first half of this year. First up is the delightfully named <a href="http://swdc.se/crashandburn2012/">Crash &amp; Burn</a> in Stockholm, on the 2nd of March. Then later in May I&#8217;ll be at Poznan in Poland for <a href="http://2012.geecon.org/">GeeCon 2012</a>. </p>
<p>This talk focuses on the kinds of constraints we should consider when evolving their architecture of our systems in order to enable rapid, frequent release. So much of the conversation about Continuous Delivery focuses on the design of build pipelines, or the nuts and bolts of CI and infrastructure automation. But often the biggest constraint in being able to incrementally roll out new features are the problems in the design of the system itself. I&#8217;ll be pulling together a series of patterns that will help you identify what to look for in your own systems when moving towards Continuous Delivery.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.magpiebrain.com/2012/01/14/new-talk-designing-for-rapid-release/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1129</post-id>
		<media:content url="https://2.gravatar.com/avatar/83551d215a052d33a92f6f18374d0c4cc32285f08f0e070ed8fb6bdcc00c85ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">samnewman</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Fabric to apply Puppet scripts</title>
		<link>https://blog.magpiebrain.com/2011/08/21/using-fabric-to-apply-puppet-scripts/</link>
					<comments>https://blog.magpiebrain.com/2011/08/21/using-fabric-to-apply-puppet-scripts/#comments</comments>
		
		<dc:creator><![CDATA[samnewman]]></dc:creator>
		<pubDate>Sun, 21 Aug 2011 15:20:54 +0000</pubDate>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[boto]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[fabric]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[python]]></category>
		<guid isPermaLink="false">http://www.magpiebrain.com/?p=1120</guid>

					<description><![CDATA[On my current client project, in terms of managing configuration of the various environments, I have separated things into two&#8230;]]></description>
										<content:encoded><![CDATA[<p>On my current client project, in terms of managing configuration of the various environments, I have separated things into two problem spaces &#8211; provisioning hosts, and configuring hosts. Part of the reason for this separation is that although targeting AWS, we do need to allow us to support alternative services in the future, but I also consider the type of tasks to be rather different and to require different types of tools.</p>
<p>For provisioning hosts I am using the Python AWS API <a href="http://boto.cloudhackers.com/">Boto</a>. For configuring the hosts once provisioned, I am using Puppet. I remain unconvinced as to the relative merits of PuppetMaster or Chef Server (see <a href="http://www.magpiebrain.com/2010/10/20/chef-versioned-recipes/">my previous post</a> on the subject) and so have decided to stick with using PuppetSolo so I can manage versioning how I would like. This leaves me with a challenge &#8211; how do I apply the puppet configuration for the hosts once provisioned with Boto? I also wanted to provide a relatively uniform command-line interface to the development team for other tasks like running builds etc. Some people use cron-based polling for this, but I wanted a more direct form of control. I also wanted to avoid the need to run any additional infrastructure, so mcollective was never something I was particularly interested in.</p>
<p>After a brief review of my &#8220;Things I should look at later&#8221; list it looked like time to give <a href="http://docs.fabfile.org/">Fabric</a> a play.</p>
<p>Fabric is a Python-based tool/library which excels at creating command-line tools for machine management. It&#8217;s bread and butter is script-based automation of machines via SSH &#8211; many people in fact use hand-rolled scripts on top of Fabric as an alternative to systems like Chef and Puppet. The documentation is very good, and I can heartily recommend the <a href="http://docs.fabfile.org/en/1.2.0/tutorial.html">Fabric tutorial</a>.</p>
<p>The workflow I wanted was simple. I wanted to be able to checkout a specific version of code locally, run one command to bring up a host and also apply a given configuration set. My potentially naive solution to this problem is to simply tar up my puppet scripts, upload them, and then run puppet. Here is the basic script:</p>
<p>[python]<br />
@task<br />
def provision-box():<br />
  public_dns = provision_using_boto()</p>
<p>  local(&quot;tar cfz /tmp/end-bundle.tgz path/to/puppet_scripts/*&quot;)<br />
  with settings(host_string=public_dns, user=&quot;ec2-user&quot;, key_filename=&quot;path/to/private_key.pem&quot;):<br />
    run(&quot;sudo yum install -y puppet&quot;)<br />
    put(&quot;/tmp/end-bundle.tgz&quot;, &quot;.&quot;)<br />
    run(&quot;tar xf end-bundle.tgz &amp;&amp; sudo puppet &#8211;modulepath=/home/ec2-user/path/to/puppet_scripts/modules path/to/puppet_scripts/manifests/myscript.pp&quot;)<br />
[/python]</p>
<p>The <code>provision_using_boto()</code> command is an exercise left to the reader, but <a href="http://boto.cloudhackers.com/ec2_tut.html">the documentation</a> should point you in the right direction. If you stuck the above command in your <code>fabfile.py</code>, all you need to do is run <code>fab provision-box</code> to do the work. The first <code>yum install</code> command is there to handle bootstraping of puppet (as it is not on the AMIs we are using) &#8211; this will be a noop if the target host already has it installed.</p>
<p>This example is much more simplified than the actual scripts as we have also implemented some logic to re-use ec2 instances to save time &amp; money, and also a simplistic role system to manage different classes of machines. I may write up those ideas in a future post.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.magpiebrain.com/2011/08/21/using-fabric-to-apply-puppet-scripts/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1120</post-id>
		<media:content url="https://2.gravatar.com/avatar/83551d215a052d33a92f6f18374d0c4cc32285f08f0e070ed8fb6bdcc00c85ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">samnewman</media:title>
		</media:content>
	</item>
		<item>
		<title>Upcoming speaking event @ JAX London</title>
		<link>https://blog.magpiebrain.com/2011/07/16/upcoming-speaking-event-jax-london/</link>
					<comments>https://blog.magpiebrain.com/2011/07/16/upcoming-speaking-event-jax-london/#respond</comments>
		
		<dc:creator><![CDATA[samnewman]]></dc:creator>
		<pubDate>Sat, 16 Jul 2011 18:27:37 +0000</pubDate>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[presentations]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[conferences]]></category>
		<category><![CDATA[jax]]></category>
		<category><![CDATA[speaking]]></category>
		<guid isPermaLink="false">http://www.magpiebrain.com/?p=1114</guid>

					<description><![CDATA[I&#8217;ll be speaking on the cloud track at JAX London 2011. The talk &#8220;Private Cloud, A Convenient Fiction&#8221; attempts to&#8230;]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ll be speaking on the cloud track at JAX London 2011. The talk &#8220;<a href="http://jaxlondon.com/2011/sessions/?tid=2174">Private Cloud, A Convenient Fiction</a>&#8221; attempts to puncture some of the FUD on the subject. The nuances between various hosting solutions are many and varied, and don&#8217;t suit being put into neat boxes like &#8216;public&#8217; and &#8216;private&#8217;. When I talk to clients about what is right to them, the types of things we discuss place different providers on a number of axis, which I hope to get across in this talk.</p>
<p>As always, you can track the conference (or note that you plan to attend) at Simon &amp; Nat&#8217;s startup <a href="http://lanyrd.com/2011/jax-london-autumn/">Lanyrd</a>, which is several shades of awesome. </p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.magpiebrain.com/2011/07/16/upcoming-speaking-event-jax-london/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1114</post-id>
		<media:thumbnail url="https://blog.magpiebrain.com/wp-content/uploads/2011/07/screen-shot-2011-07-16-at-19-26-14.png" />
		<media:content url="https://blog.magpiebrain.com/wp-content/uploads/2011/07/screen-shot-2011-07-16-at-19-26-14.png" medium="image">
			<media:title type="html">JAX London 2011</media:title>
		</media:content>

		<media:content url="https://2.gravatar.com/avatar/83551d215a052d33a92f6f18374d0c4cc32285f08f0e070ed8fb6bdcc00c85ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">samnewman</media:title>
		</media:content>
	</item>
		<item>
		<title>Apache and the case of the missing memory</title>
		<link>https://blog.magpiebrain.com/2011/07/13/apache-and-the-case-of-the-missing-memory/</link>
					<comments>https://blog.magpiebrain.com/2011/07/13/apache-and-the-case-of-the-missing-memory/#comments</comments>
		
		<dc:creator><![CDATA[samnewman]]></dc:creator>
		<pubDate>Wed, 13 Jul 2011 11:26:40 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[sysadmin]]></category>
		<guid isPermaLink="false">http://www.magpiebrain.com/?p=1106</guid>

					<description><![CDATA[It seems I spoke too soon. Just one day after thinking I had tracked down the source of the trouble,&#8230;]]></description>
										<content:encoded><![CDATA[<p>It seems I <a href="http://www.magpiebrain.com/2011/07/12/tracking-down-rogue-processes/">spoke too soon</a>. Just one day after thinking I had tracked down the source of the trouble, and yesterday evening brought another outage. The graph in CloudWatch was all too familiar, showing the huge uptick in CPU use. The box was again unresponsive and had to be restarted. Checking <code>cpu_log</code> for a likely culprit, the entries looked odd:</p>
<p>[plain light=&#8221;true&#8221;]<br />
2011-07-13 00:12:22 www-data 26096 21.4  0.9 160732  5972 ?        D    Jul12   5:30 /usr/sbin/apache2 -k start<br />
2011-07-13 00:12:25 www-data 26096 21.4  0.9 160736  6040 ?        R    Jul12   5:30 /usr/sbin/apache2 -k start<br />
2011-07-13 00:12:22 www-data 26096 21.3  0.9 160732  5972 ?        D    Jul12   5:30 /usr/sbin/apache2 -k start<br />
2011-07-13 00:12:22 root     26179 24.0  0.0   4220   584 ?        S    00:12   0:00 /bin/sh /home/ubuntu/tools/cpu_log<br />
[/plain]</p>
<p>No entries from Postfix &#8211; good &#8211; but now other processes are having trouble. This was starting to point away from one rogue process gobbling CPU, to high CPU use being a symptom of something else. What can cause very high CPU use? Among other things, swapping memory. A process chewing up all available memory could easily cause these kinds of symptoms. A quick scan through <code>syslog</code> showed me something I should have spotted earlier. If it wasn&#8217;t the smoking gun, then at least something pretty close:</p>
<p>[plain light=&#8221;true&#8221;]<br />
Jul 13 00:11:28 domU-12-31-39-01-F0-E5 kernel: [38837.985499] apache2 invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0<br />
[/plain]</p>
<p>This doesn&#8217;t mean that Apache is to blame, just that it was a process which oom-killer tried to take out in order to free up memory. And just prior to the outage itself in the apache logs:</p>
<p>[plain light=&#8221;true&#8221;]<br />
[Tue Jul 12 23:48:24 2011] [error] (12)Cannot allocate memory: fork: Unable to fork new process<br />
[/plain]</p>
<p>At this point my mind was already turning to the fact that I hadn&#8217;t done *any* tuning of Apache processes or PHP. After googling around for a bit, a few things looked wrong in my config. Here was the untuned default that Ubuntu gave me:</p>
<p>[plain light=&#8221;true&#8221;]<br />
&lt;IfModule mpm_prefork_module&gt;<br />
    StartServers            5<br />
    MinSpareServers         5<br />
    MaxSpareServers        10<br />
    MaxClients            150<br />
    MaxRequestsPerChild     0<br />
&lt;/IfModule&gt;<br />
[/plain]</p>
<p>In general <code>MaxClients</code> refers to the maximum number of simultaneous requests that will be served. On prefork Apache, like mine, <code>MaxClients</code> also refers to the max number of child processes that get spawned. A simple <code>ps</code> showed that even after a restart, each apache process was consuming up to 35MB of memory. The host in question has 1GB in RAM &#8211; it was clear that even with nothing else running on the box, with that sort of memory footprint I would exhaust memory way before the <code>MaxClients</code> threshold was reached. Even more worrying, the <code>MaxRequestsPerChild</code> was set to zero, meaning that the child processes would never be restarted. If a memory leak was occurring inside the child Apache process, it could carry on eating memory until the box comes crashing to it&#8217;s knees. After some quick maths I decided to reduce my <code>MaxClients</code> down to a more manageable 25, but also set <code>MaxRequestsPerChild</code> to 1000. My hope is that this may buy me some more time to try and track down where the memory use is occurring.</p>
<p>This has spurned me on to finally invest some time looking at nginx. This weekend may see me putting in nginx side by side with a view to moving away from Apache &#8211; from all reports this may allow me to run my sites with a much lower footprint. But if the last couple of days has taught me anything, it&#8217;s that I should be so sure to rush to the conclusion that I&#8217;ve finally tracked this problem down. If I&#8217;m still having trouble at the weekend, I may well just clone the box and try and reproduce the problem with some performance tests.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.magpiebrain.com/2011/07/13/apache-and-the-case-of-the-missing-memory/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1106</post-id>
		<media:thumbnail url="https://blog.magpiebrain.com/wp-content/uploads/2011/07/facepalm.jpg" />
		<media:content url="https://blog.magpiebrain.com/wp-content/uploads/2011/07/facepalm.jpg" medium="image">
			<media:title type="html">Facepalm</media:title>
		</media:content>

		<media:content url="https://2.gravatar.com/avatar/83551d215a052d33a92f6f18374d0c4cc32285f08f0e070ed8fb6bdcc00c85ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">samnewman</media:title>
		</media:content>
	</item>
	</channel>
</rss>
