<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Always Get Better</title>
	
	<link>http://www.alwaysgetbetter.com/blog</link>
	<description>Never stop looking for ways to improve</description>
	<lastBuildDate>Mon, 30 Apr 2012 20:01:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AlwaysGetBetter" /><feedburner:info uri="alwaysgetbetter" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Re-Learning How to Write</title>
		<link>http://feedproxy.google.com/~r/AlwaysGetBetter/~3/CTMgdPec290/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2012/04/30/relearning-write/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 20:01:16 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[o'reilly]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=495</guid>
		<description><![CDATA[In just two weeks, Node: Up and Running will be released by O&#8217;Reilly Media. Writing a book has been a lot of hard work but also a terrific learning experience that I would love to repeat. The biggest takeaway for me was how often I make stupid mistakes in my writing. As a developer and [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>In just two weeks, Node: Up and Running will be released by O&#8217;Reilly Media. Writing a book has been a lot of hard work but also a terrific learning experience that I would love to repeat.</p>
<p>The biggest takeaway for me was how often I make stupid mistakes in my writing. As a developer and manager, I rely on my speaking and writing abilities every day &#8211; so I take my ability to express myself for granted because I have to do it every day.</p>
<p>When a professional editor takes a piece of writing, they aren&#8217;t looking at it in the same way a co-worker would. A co-worker knows me, understands some of the subtleties of the context I&#8217;m writing about, and can subconsciously apply meaning to ambiguities in the text or conversation. A casual reader doesn&#8217;t have the same context, and the copy editor is able to filter that out and make adjustments to the text that leave my meaning intact but change the delivery.</p>
<p>In other words, the text that came out of the editing process makes me look really smart (I wish!). I&#8217;ve learned the secret to clear communication is in keeping the message brief. Especially in a technical book, the audience can&#8217;t be expected to deconstruct prose &#8211; it&#8217;s up to the writer to make their point and get out of the way.</p>
<p>I&#8217;ve also learned that I use the same turns of phrases over and over again. Reading 50 pages of my own writing in a row with the same sentence transitions is boring as heck, and I&#8217;m able to see this strikingly clear when it&#8217;s annotated by a totally impartial writer.</p>
<div style="width:468px;margin:0 auto">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-0410364841759590";
/* Homepage, 468x60 ads, After posts, created 12/19/08 */
google_ad_slot = "4210204644";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>No related posts.</p><img src="http://feeds.feedburner.com/~r/AlwaysGetBetter/~4/CTMgdPec290" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2012/04/30/relearning-write/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwaysgetbetter.com/blog/2012/04/30/relearning-write/</feedburner:origLink></item>
		<item>
		<title>log4php Performance</title>
		<link>http://feedproxy.google.com/~r/AlwaysGetBetter/~3/ltJk0KY93dM/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2012/02/29/log4php-performance/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 11:33:41 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=492</guid>
		<description><![CDATA[photo credit: U.S. Fish and Wildlife Service &#8211; Midwest Region We can take for granted that whenever we introduce a library or framework to our application, we incur an overhead cost. The cost varies depending on what we&#8217;re trying to do, but we generally accept that the lost performance is worth it for the increased [...]
Related posts:<ol>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/12/20/fastcgi-nginx-performance-vm/' rel='bookmark' title='Using FastCGI with Nginx for Performance on a VM'>Using FastCGI with Nginx for Performance on a VM</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class=alignright><a href="http://www.flickr.com/photos/49208525@N08/6892108297/" title="log pile 2" target="_blank"><img src="http://farm8.static.flickr.com/7037/6892108297_14c01f3890_m.jpg" alt="log pile 2" border="0" /></a><br /><small><a href="http://creativecommons.org/licenses/by/2.0/" title="Attribution License" target="_blank"><img src="http://www.alwaysgetbetter.com/blog/wp-content/plugins/photo-dropper/images/cc.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/49208525@N08/6892108297/" title="U.S. Fish and Wildlife Service - Midwest Region" target="_blank">U.S. Fish and Wildlife Service &#8211; Midwest Region</a></small></div>
<p>We can take for granted that whenever we introduce a library or framework to our application, we incur an overhead cost.  The cost varies depending on what we&#8217;re trying to do, but we generally accept that the lost performance is worth it for the increased maintainability, functionality or ease of use.</p>
<p>For many teams, logging is something that gets thrown in the mix at the last minute rather than through of all the way through. That&#8217;s a shame because a well-implemented logging solution can make the difference between understanding what is going on in your system and having to guess by looking at the code. It needs to be lightweight enough that the overall performance is not affected, but feature-rich enough that important issues are surfaced properly.</p>
<p>Java programmers have had log4j for a long time, and log4net is a similarly mature solution in the .NET world. I&#8217;ve been watching log4php for awhile and now that it has escaped the Apache Incubator it is impressively full-featured and fast. But how much do all its features cost?</p>
<p><strong>Benchmarks</strong><br />
I&#8217;ll be looking into different options as I go, but let&#8217;s consider a very basic case &#8211; you append all of your events to a text file. I&#8217;ve created a configuration that ignores all &#8216;trace&#8217; and &#8216;debug&#8217; events so only events with a severity of &#8216;INFO&#8217; or above are covered.</p>
<p>In 5 seconds, this is what I saw:</p>
<table>
<tr>
<th>Test</th>
<th>Iterations</th>
</tr>
<tr>
<td>BASIC (direct PHP)</td>
<td>45,421</td>
</tr>
<tr>
<td>INFO STATIC</td>
<td>45,383</td>
</tr>
<tr>
<td>INFO DYNAMIC</td>
<td>41,847</td>
</tr>
<tr>
<td>INFO STATIC (no check)</td>
<td>51,801</td>
</tr>
<tr>
<td>INFO DYNAMIC (no check)</td>
<td>47,756</td>
</tr>
<tr>
<td>TRACE STATIC</td>
<td>310,255</td>
</tr>
<tr>
<td>TRACE DYNAMIC</td>
<td>213,554</td>
</tr>
<tr>
<td>TRACE STATIC (no check)</td>
<td>271,043</tr>
<tr>
<td>TRACE DYNAMIC (no check)</td>
<td>196,653</tr>
</table>
<p><strong>Tests</strong><br />
What is all that? There are two ways to initialize the logger class &#8211; statically, meaning declared once and used again and again; and dynamically, meaning declared each time. With log4X, we typically perform a log level check first, for example isTraceEnabled() to determine whether to proceed with the actual logging work.</p>
<p><strong>Results</strong><br />
I was surprised by how little log4php actually lost in terms of speed versus raw PHP. The authors have clearly done a thorough job of optimizing their library because it runs at 90% of the speed of a direct access.</p>
<p>I&#8217;ve always intuitively used loggers as static variables &#8211; initialize once and use over and over. This seems to be the right way by a huge margin.</p>
<p>Checking for the log level before appending to the log was a big win for the INFO messages, which are always logged to the file due to the configuration settings. The intended use is to allow programmers to sprinkle their code with debug statements which don&#8217;t get processed &#8211; and therefore slow down &#8211; the production code. I would be very happen with this in my project. In the INFO metrics, the check slowed things down a bit &#8211; explained because the actual logging function performs the same check &#8211; so we are taking a double hit. But wait, there is a good reason&#8230;</p>
<p>The TRACE metric is interesting &#8211; these are events which are NOT appended to the log. In that case, when the check is not performed, we pass through the code more times. When the check is performed, the code has to execute deeper on the call stack before it figures out we aren&#8217;t doing any actual logging, taking more time.</p>
<p><strong>Conclusion</strong><br />
If you know you will be logging every single event, don&#8217;t do a check. Otherwise do the check &#8211; it will save a lot of wasted cycles.</p>
<p>Related posts:<ol>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/12/20/fastcgi-nginx-performance-vm/' rel='bookmark' title='Using FastCGI with Nginx for Performance on a VM'>Using FastCGI with Nginx for Performance on a VM</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AlwaysGetBetter/~4/ltJk0KY93dM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2012/02/29/log4php-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwaysgetbetter.com/blog/2012/02/29/log4php-performance/</feedburner:origLink></item>
		<item>
		<title>Setting up WordPress with nginx and FastCGI</title>
		<link>http://feedproxy.google.com/~r/AlwaysGetBetter/~3/UPK971X-yh4/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2012/01/30/setting-wordpress-nginx-fastcgi/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 12:00:17 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[varnish]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=490</guid>
		<description><![CDATA[All web site owners should feel a burning need to speed. Studies have shown that viewers waiting more than 2 or 3 seconds for content to load online are likely to leave without allowing the page to fully load. This is particularly bad if you&#8217;re trying to run a web site that relies on visitors [...]
Related posts:<ol>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/12/20/fastcgi-nginx-performance-vm/' rel='bookmark' title='Using FastCGI with Nginx for Performance on a VM'>Using FastCGI with Nginx for Performance on a VM</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>All web site owners should feel a burning need to speed. Studies have shown that viewers waiting more than 2 or 3 seconds for content to load online are likely to leave without allowing the page to fully load. This is particularly bad if you&#8217;re trying to run a web site that relies on visitors to generate some kind of income &#8211; content is king but speed keeps the king&#8217;s coffers flowing.</p>
<p>If your website isn&#8217;t the fastest it can be, you can take some comfort in the fact that the majority of the &#8220;top&#8221; web sites also suffer from page load times pushing up into the 10 second range (have you BEEN to Amazon lately?). But do take the time to download YSlow today and use its suggestions to start making radical improvements.</p>
<p>I&#8217;ve been very interested in web server performance because it is the first leg of the web page&#8217;s journey to the end user. The speed of execution at the server level is capable of making or breaking the user&#8217;s experience by controlling the amount of &#8216;lag time&#8217; between the web page request and visible activity in the web browser. We want our server to send page data as immediately as possible so the browser can begin rendering it and downloading supporting files.</p>
<p><a href="http://www.alwaysgetbetter.com/blog/wp-content/uploads/2011/12/agb_new.png"><img class="alignright  wp-image-463" title="agb_new" src="http://www.alwaysgetbetter.com/blog/wp-content/uploads/2011/12/agb_new.png" alt="" width="347" height="347" /></a>Not long ago, I described <a href="http://www.alwaysgetbetter.com/blog/2011/12/20/fastcgi-nginx-performance-vm/">my web stack</a> and explained why I moved away from the &#8220;safe&#8221; Apache server solution in favour of nginx. Since nginx doesn&#8217;t have a PHP module I had to use PHP&#8217;s FastCGI (PHP FPM) server with nginx as a reverse proxy. Additionally, I used memcached to store sessions rather than writing to disk.</p>
<p>Here are the configuration steps I took to realize this stack:</p>
<p><strong>1. Memcached Sessions</strong><br />
Using memcached for sessions gives me slightly better performance on my Rackspace VM because in-memory reading&amp;writing is hugely faster than reading&amp;writing to a virtualized disk. I went into a lot more detail about this last April when I wrote about <a href="http://www.alwaysgetbetter.com/blog/2011/04/09/memcached-session-handler/">how to use memcached as a session handler in PHP</a>.</p>
<p><strong>2. PHP FPM</strong><br />
The newest Ubuntu distributions have a package <strong>php5-fpm</strong> that installs PHP5 FastCGI and an init.d script for it. Once installed, you can tweak your php.ini settings to suit, depending on your system&#8217;s configuration. (Maybe we can get into this another time.)</p>
<p><strong>3. Nginx</strong><br />
Once PHP FPM was installed, I created a site entry that would pass PHP requests forward to the FastCGI server, while serving other files directly. Since the majority of my static content (css, javascript, images) have already been moved to a content delivery network, nginx has very little actual work to do.</p>
<p><code><br />
server {<br />
listen 80;<br />
server_name sitename.com www.sitename.com;<br />
access_log /var/log/nginx/sitename-access.log;<br />
error_log /var/log/nginx/sitename-error.log;<br />
# serve static files<br />
location / {<br />
root /www/sitename.com/html;<br />
index index.php index.html index.htm;</code></p>
<p># this serves static files that exists without<br />
# running other rewrite tests<br />
if (-f $request_filename) {<br />
expires 30d;<br />
break;<br />
}</p>
<p># this sends all-non-existing file or directory requests to index.php<br />
if (!-e $request_filename) {<br />
rewrite ^(.+)$ /index.php?q=$1 last;<br />
}<br />
}</p>
<p>location ~ \.php$ {<br />
fastcgi_pass 127.0.0.1:9000;<br />
fastcgi_index index.php;<br />
fastcgi_param SCRIPT_FILENAME /www/sitename.com/html$fastcgi_script_name;<br />
include fastcgi_params;<br />
}<br />
}</p>
<p>The <strong>fastcgi_param</strong> setting controls which script is executed, based upon the root path of the site being accessed. All of the requests parameters are passed through to PHP, and once the configuration is started up I didn&#8217;t miss Apache one little bit.</p>
<p><strong>Improvements</strong><br />
My next step will be to put a varnish server in front of nginx. Since the majority of my site traffic comes from search engine results where a user has not yet been registered to the site or needs refreshed content, Varnish can step in and serve a fully cached version of my pages from memory far faster than FastCGI can render the WordPress code. I&#8217;ll experiment with this setup in the coming months and post my results.</p>
<p>Related posts:<ol>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/12/20/fastcgi-nginx-performance-vm/' rel='bookmark' title='Using FastCGI with Nginx for Performance on a VM'>Using FastCGI with Nginx for Performance on a VM</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AlwaysGetBetter/~4/UPK971X-yh4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2012/01/30/setting-wordpress-nginx-fastcgi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwaysgetbetter.com/blog/2012/01/30/setting-wordpress-nginx-fastcgi/</feedburner:origLink></item>
		<item>
		<title>HP Releases Enyo 2.0</title>
		<link>http://feedproxy.google.com/~r/AlwaysGetBetter/~3/w_W6xngCfiQ/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2012/01/25/hp-releases-enyo-20/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 01:56:27 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebOS]]></category>
		<category><![CDATA[enyo]]></category>
		<category><![CDATA[hp]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[webos]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=485</guid>
		<description><![CDATA[Now that WebOS is being made open source, HP has released a new version of the Enyo JavaScript framework. Whereas the first version of the framework only supported Webkit-based environments (like the HP Touchpad, or Safari or Chrome), the newer version has expanded support for Firefox and IE9 as well. Developers who created apps with [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Enyo Logo" src="http://cdn.precentral.net/resources/images/000/106/057/large/enyo-html5-palm-logos.png" alt="" width="330" height="169" />Now that WebOS is being made open source, HP has released a new version of the Enyo JavaScript framework. Whereas the first version of the framework only supported Webkit-based environments (like the HP Touchpad, or Safari or Chrome), the newer version has expanded support for Firefox and IE9 as well. Developers who created apps with the old framework will have to wait a little while longer before all of the widgets and controls from Enyo 1.0 are ported over.</p>
<p>What does this mean for app developers? Now that Enyo is open-source, it means applications built on the platform will run on Android and iOS. But it&#8217;s not a disruptive technology &#8211; both Android and iOS have supported HTML5 applications for quite awhile; HP will be competing against mature frameworks like jQuery Mobile.</p>
<p>As a WebOS enthusiast I am definitely going to put some time into continuing my explorations of Enyo, but it&#8217;s getting harder and harder to justify the investment. My Pre is getting pretty old at this point, and hardware manufacturers have yet to express interest in making new devices to take advantage of WebOS. If I end up switching to Android with my next hardware purchase, it&#8217;s going to shift my priorities away from Enyo and its brethren.</p>
<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/AlwaysGetBetter/~4/w_W6xngCfiQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2012/01/25/hp-releases-enyo-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwaysgetbetter.com/blog/2012/01/25/hp-releases-enyo-20/</feedburner:origLink></item>
		<item>
		<title>4 Year Blogiversary</title>
		<link>http://feedproxy.google.com/~r/AlwaysGetBetter/~3/YnmhVkAGjfs/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2012/01/16/4-year-blogiversary/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 10:00:39 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=481</guid>
		<description><![CDATA[photo credit: various brennemans It&#8217;s hard to believe but this site is four years old. Wow! Time has flown, and I&#8217;ve learned a lot &#8211; hopefully these years have been helpful for you too! No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<div class=alignright><a href="http://www.flickr.com/photos/58143970@N00/6515737041/" title="the first cut" target="_blank"><img src="http://farm8.static.flickr.com/7024/6515737041_cd6f82a3c2_m.jpg" alt="the first cut" border="0" /></a><br /><small><a href="http://creativecommons.org/licenses/by-sa/2.0/" title="Attribution-ShareAlike License" target="_blank"><img src="http://www.alwaysgetbetter.com/blog/wp-content/plugins/photo-dropper/images/cc.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/58143970@N00/6515737041/" title="various brennemans" target="_blank">various brennemans</a></small></div>
<p>It&#8217;s hard to believe but this site is four years old. Wow! Time has flown, and I&#8217;ve learned a lot &#8211; hopefully these years have been helpful for you too!</p>
<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/AlwaysGetBetter/~4/YnmhVkAGjfs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2012/01/16/4-year-blogiversary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwaysgetbetter.com/blog/2012/01/16/4-year-blogiversary/</feedburner:origLink></item>
		<item>
		<title>Humans.txt – the Anti-Robots.txt</title>
		<link>http://feedproxy.google.com/~r/AlwaysGetBetter/~3/i5Gs2e01Yrk/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2012/01/14/humanstxt-antirobotstxt/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 01:21:24 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[attribution]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=450</guid>
		<description><![CDATA[photo credit: langfordw If you don&#8217;t want a search engine to read some or all of the files on your site, you can create a robots.txt file. (Looking through the blog archive, I realize I&#8217;ve never gone through the construction and contents of that important file, so this is a promise to one day return [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<div class=alignright><a href="http://www.flickr.com/photos/24375810@N06/6611017007/" title="Mimbo - A Friendly Robot" target="_blank"><img src="http://farm8.static.flickr.com/7019/6611017007_94aec8ded9_m.jpg" alt="Mimbo - A Friendly Robot" border="0" /></a><br /><small><a href="http://creativecommons.org/licenses/by/2.0/" title="Attribution License" target="_blank"><img src="http://www.alwaysgetbetter.com/blog/wp-content/plugins/photo-dropper/images/cc.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/24375810@N06/6611017007/" title="langfordw" target="_blank">langfordw</a></small></div>
<p>If you don&#8217;t want a search engine to read some or all of the files on your site, you can create a <em>robots.txt</em> file. (Looking through the blog archive, I realize I&#8217;ve never gone through the construction and contents of that important file, so this is a promise to one day return and fix that!)</p>
<p>When you want the opposite &#8211; accessible pages and author credit, create a <em>humans.txt</em> file. Although not an &#8220;official&#8221; standard, it is a fun way to acknowledge the (sometimes many) hardworking individuals behind the creation of a web site.</p>
<p>An example is:</p>
<pre>
/* TEAM */
Leader: Mike Wilson
Site: http://www.alwaysgetbetter.com
Twitter: HawkWilson
Location: Ottawa, ON

/* THANKS */
Seth Godin: http://www.sethgodin.com
Steve Pavlina: http://www.stevepavlina.com
Phil Haack: http://haacked.com

/* SITE */
Last Update: Jan 14, 2012
Standards: HTML5, CSS3
Software: WordPress
</pre>
<p>In most cases, you would want to include at least a TEAM and SITE section. Clearly the exact fields are left to your imagination, but it&#8217;s a very simple way to acknowledge the people who helps (directly or in spirit) a site to get to fruition.</p>
<p>For more information about humans.txt, check out the initiative&#8217;s home page at <a href="http://humanstxt.org/">http://humanstxt.org/</a>.</p>
<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/AlwaysGetBetter/~4/i5Gs2e01Yrk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2012/01/14/humanstxt-antirobotstxt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwaysgetbetter.com/blog/2012/01/14/humanstxt-antirobotstxt/</feedburner:origLink></item>
		<item>
		<title>2011 In Review</title>
		<link>http://feedproxy.google.com/~r/AlwaysGetBetter/~3/oFTD2VQvpnw/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2011/12/31/2011-review/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 18:35:13 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Employment]]></category>
		<category><![CDATA[General Programming]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=471</guid>
		<description><![CDATA[photo credit: mikecogh This year started off with a foray into Rails, an experience I won&#8217;t be rushing to complete. Most of my time was spent building a small application during the Christmas break in 2010, but in 2011 I moved that site into production and wrote a little bit about separating production and development [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<div class=alignright><a href="http://www.flickr.com/photos/89165847@N00/6175196194/" title="Hot Desk" target="_blank"><img src="http://farm7.static.flickr.com/6179/6175196194_9689e42f7e_m.jpg" alt="Hot Desk" border="0" /></a><br /><small><a href="http://creativecommons.org/licenses/by-sa/2.0/" title="Attribution-ShareAlike License" target="_blank"><img src="http://www.alwaysgetbetter.com/blog/wp-content/plugins/photo-dropper/images/cc.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/89165847@N00/6175196194/" title="mikecogh" target="_blank">mikecogh</a></small></div>
<p>This year started off with a foray into Rails, an experience I won&#8217;t be rushing to complete. Most of my time was spent building a small application during the Christmas break in 2010, but in 2011 I moved that site into production and <a href="http://www.alwaysgetbetter.com/blog/2011/03/03/displaying-productiononly-markup-rails/">wrote a little bit about separating production and development values</a> (a feat I repeated for the <a href="http://www.alwaysgetbetter.com/blog/2011/05/09/accessing-configuration-parameters-play-frameworks-template-engine/">Play! framework</a>, which I actually like, later in the year). I think the only thing I really like from Rails, and this is a bit of a stretch, is the <a href="http://www.alwaysgetbetter.com/blog/2011/04/20/database-migrations/">database migrations</a>.</p>
<p>Having moved entirely over to a LAMP platform professionally, and getting good at the <a href="http://www.alwaysgetbetter.com/blog/2011/04/26/protect-ssh-server-rsa-keys/">security nuances</a> plus everything else, I reminisced a little about some of the creature comforts I missed in C#, like <a href="http://www.alwaysgetbetter.com/blog/2011/03/04/defaulting-null-variables/">operators for default null variables</a>. But <a href="http://www.alwaysgetbetter.com/blog/2011/04/15/backup-time/">when I discovered Time Machine</a> on my Mac, there was no going back &#8211; until the company switched directions and I got thrown back into .NET development.</p>
<p>That&#8217;s right &#8211; back to .NET, and deep into the Windows Azure cloud. I dealt with things like figuring out <a href="http://www.alwaysgetbetter.com/blog/2011/04/24/azure-table-storage-azure-sql/">which is better &#8211; table storage or SQL Azure</a>, and figuring out the nuances of their multiple SLAs, and <a href="http://www.alwaysgetbetter.com/blog/2011/04/25/ensure-sla-multiple-web-role-instances-windows-azure/">how to ensure we actually have Azure Compute instances on-line when it hits the fan</a>. At this point <a href="http://www.alwaysgetbetter.com/blog/2011/08/02/windows-azure-thoughts-months/">I have a pretty good handle on Azure&#8217;s strengths and weaknesses</a> and my overall impression of the platform is very positive. If I continue building sites on the Microsoft stack, I would definitely continue to use Azure &#8211; it <em>seems</em> more expensive than other options at first glance, but it has some serious computing power behind it and takes the majority of administration headaches off of my plate. It really has enabled me to, for the most part, just focus on development whereas I was spending an increasing amount of my work day on system administration issues when supporting the LAMP platform.</p>
<p>Scalability and high availability have been on my mind a lot, and I&#8217;ve been looking into some more &#8216;off-beat&#8217; database solutions like <a href="http://www.alwaysgetbetter.com/blog/2011/03/24/drizzle-mysql-cloud/">Drizzle</a> for my transactional needs, as well as <a href="http://www.alwaysgetbetter.com/blog/2011/04/10/memcache-mysqls-hero/">speeding up existing deployments</a> by <a href="http://www.alwaysgetbetter.com/blog/2011/04/09/memcached-session-handler/">moving as much as possible into RAM</a>. There&#8217;s always a battle between <a href="http://www.alwaysgetbetter.com/blog/2011/04/11/play-framework-saves-world/">changing the way we work to take advantage of the new paradigm</a> or changing our <a href="http://www.alwaysgetbetter.com/blog/2011/04/12/performance-tuning-apache/">existing configuration</a> to get some more life out of it.</p>
<p>The whole cloud computing buzz <a href="http://www.alwaysgetbetter.com/blog/2011/04/05/cloud-computing-magical/">feels tired</a> but has enabled a whole new class of online business. If you have a lot of commodity hardware you can achieve, <a href="http://www.alwaysgetbetter.com/blog/2011/04/21/accelerate-site-content-delivery-network/">very cheaply</a>, <a href="http://www.alwaysgetbetter.com/blog/2011/04/16/small-site-big-footprint/">feats that were only possible with an expensive dedicated network</a> just a few years ago. Sure, it adds a lot of new choke points <a href="http://www.alwaysgetbetter.com/blog/2011/04/19/tracking-website-speed-problems/">you will need good people to help sort through</a>, which is giving rise to a whole new sub-category of programmer specialization to make hiring in 2012 even more challenging.</p>
<p>There is a downside to all the cloud computing, though, as we learned during the high profile <a href="http://www.alwaysgetbetter.com/blog/2011/04/23/surviving-cloud-failures/">Amazon failures &#8211; backups are important</a>. This includes geographically-redundant systems that most organizations don&#8217;t have the experience to deal effectively with just yet. Even so, the biggest lesson I learned was <strong>never let your server run into swap space</strong> or your performance will nose-dive. The growth of this site even prompted me to <a href="http://www.alwaysgetbetter.com/blog/2011/12/20/fastcgi-nginx-performance-vm/">move more of the site into memory</a> which prevented me from needing to spend a lot of money upgrading my infrastructure.</p>
<p>Social media continues to grow, with companies <a href="http://www.alwaysgetbetter.com/blog/2011/04/08/command-control-social-media/">realizing they can&#8217;t control its effect on their business in traditional ways</a> and less-than-useless cons ruining it for everyone by <a href="http://www.alwaysgetbetter.com/blog/2011/04/07/hire-social-media-expert/">selling CEOs on cheap gimmicks</a>.</p>
<p>Since my third child was born in February, I&#8217;ve definitely taken some time to sotp and reflect on what I want to work on, <a href="http://www.alwaysgetbetter.com/blog/2011/04/06/overwork-creative-work-ethic/">why I want to keep working</a>, and what the next steps are career-wise and life-wise. I want to provide the best that I can for my family and 2012 is going to see a radical course change as I start to shift gears and begin building something that will really last, even outlast me. <a href="http://www.alwaysgetbetter.com/blog/2011/04/14/blog-living/">When will my website start paying my bills?</a> I don&#8217;t expect it will.</p>
<p>I learned a lot by running dozens (over a hundred?) <a href="http://www.alwaysgetbetter.com/blog/2011/04/13/interview-process/">job interviews</a> in the past two years. Ignoring the old adage that you shouldn&#8217;t judge a book by it&#8217;s cover, I learned that you <em>can</em> tell with pretty good accuracy whether or not someone will be a good match for your company within the first five minutes of an interview. I&#8217;m less interested in hiring people with domain knowledge than I am in surrounding myself with the most intelligent developers I can find &#8211; one is a skill that can be taught, the other is an aptitude candidates need to bring to the table. Really, when it comes down to it, what I really want is for people I hire to <a href="http://www.alwaysgetbetter.com/blog/2011/04/27/letter-word/">stand up for themselves (since they are adults)</a> and <a href="http://www.alwaysgetbetter.com/blog/2011/04/17/win-work/">make me look good</a> by being awesome at what they do.</p>
<p>I also learned a lot by being responsible for some very large projects; things like <a href="http://www.alwaysgetbetter.com/blog/2011/04/22/rely-continuous-integration/">the importance of continuous integration</a>.</p>
<p>What&#8217;s next in 2012? Look for <a href="http://www.alwaysgetbetter.com/blog/2011/04/28/pintsized-mobile-devices/">mobile device use to continue growth</a> &#8211; every developer who plans to stay employed needs to know something about mobile development, because it&#8217;s going to be ubiquitous with regular desktop programming very soon. Now that version 0.6 has been released with Windows support <a href="http://www.alwaysgetbetter.com/blog/2011/11/07/nodejs-06-released/">is Node.js ready for prime-time</a>? I had the opportunity to play with it a lot over the past few month &#8211; look for a book early in the new year co-authored by yours truly.</p>
<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/AlwaysGetBetter/~4/oFTD2VQvpnw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2011/12/31/2011-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwaysgetbetter.com/blog/2011/12/31/2011-review/</feedburner:origLink></item>
		<item>
		<title>Using FastCGI with Nginx for Performance on a VM</title>
		<link>http://feedproxy.google.com/~r/AlwaysGetBetter/~3/repMQOze3cg/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2011/12/20/fastcgi-nginx-performance-vm/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 19:08:08 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[General Programming]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=461</guid>
		<description><![CDATA[This weekend I decided to play around with the configuration on my Rackspace Cloud Server. Since our various websites have been doing well lately, the relatively low-powered machine I am running on is starting to fill up its available RAM. So far so good but as everyone quickly learns &#8211; running out of memory and [...]
Related posts:<ol>
<li><a href='http://www.alwaysgetbetter.com/blog/2012/01/30/setting-wordpress-nginx-fastcgi/' rel='bookmark' title='Setting up WordPress with nginx and FastCGI'>Setting up WordPress with nginx and FastCGI</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This weekend I decided to play around with the configuration on my Rackspace Cloud Server. Since our various websites have been doing well lately, the relatively low-powered machine I am running on is starting to fill up its available RAM. So far so good but as everyone quickly learns &#8211; running out of memory and <a href="http://www.alwaysgetbetter.com/blog/2011/04/12/performance-tuning-apache/">hitting the swap space is a performance killer</a>. Since I want my sites to continue to do well, I decided to take action before they hit the RAM limit and start swapping to disk.</p>
<p><a href="http://www.alwaysgetbetter.com/blog/wp-content/uploads/2011/12/agb_old.png"><img class="alignleft size-full wp-image-462" title="Old Site Architecture" src="http://www.alwaysgetbetter.com/blog/wp-content/uploads/2011/12/agb_old.png" alt="" width="347" height="347" /></a> This is the old architecture I had deployed. Apache &#8211; the Internet&#8217;s workhorse &#8211; to perform all of the PHP processing, with Nginx as a reverse proxy, passing dynamic (PHP) requests to Apache but serving static files directly to <a href="http://www.alwaysgetbetter.com/blog/2010/09/25/give-apache-break-nginx/">give Apache a break</a> and cut down its footprint.</p>
<p>I optimized MySQL with a large buffer, so it serves the vast majority of queries directly from memory.</p>
<p>The two places that hit the filesystem are Nginx and PHP &#8211; Nginx for static files (as mentioned, to take the load of Apache which would spin up a new instance for each file it serves) and PHP for session data (this is PHP&#8217;s default setting).</p>
<p>&nbsp;</p>
<p><a href="http://www.alwaysgetbetter.com/blog/wp-content/uploads/2011/12/agb_new.png"><img class="alignright size-full wp-image-463" title="agb_new" src="http://www.alwaysgetbetter.com/blog/wp-content/uploads/2011/12/agb_new.png" alt="" width="347" height="347" /></a>This is the new setup, and is very similar to the old with two key differences: Apache is gone, and Memcached is now in the mix.</p>
<p>As site traffic increased I noticed that Apache was using up bigger and bigger chunks of the system RAM compared to all of the other processes. I could pare this down by putting further restrictions on the number of child processes, decrease the number of connections before recycling, and limiting the maximum memory for each process, but that seemed like a lot of work when I already had one foot into a more scalable solution.</p>
<p>Taking advantage of the new(ish) since PHP 5.3.3 FastCGI Process Manager (FPM), I updated Nginx to send PHP traffic directly to PHP without using Apache as a middleman. The default settings were too generous for my fairly weak server, and the memory usage shot up. But by tweaking it down to 3 processes recycling after 500 requests, I&#8217;m now using half the physical memory as I was with Apache.</p>
<p>Previously I wrote about using <a href="http://www.alwaysgetbetter.com/blog/2011/04/09/memcached-session-handler/">Memcached as a PHP Session Handler</a> and that&#8217;s exactly what I did here. Now the Filesystem is only hit for static files and the first run of PHP scripts &#8211; everything else is served from memory.</p>
<p>It may seem a little counter-intuitive that I cut memory consumption by moving more services into memory, but the trade-off improvements realized by hitting the disk less means that responses are sent out 30% faster, meaning I can fit more traffic onto the same machine and expect the same responsiveness on the web site.</p>
<p>One thing I could do to improve this even more would be to put Varnish in front of Nginx and serve all static content &#8211; including rendered PHP &#8211; from memory, which would give some seriously (<100ms) fast performance on read-only WordPress pages when users are not logged in. I may do that if traffic continues to rise, but for the moment the combination of Nginx's static file speed with <a href="http://www.alwaysgetbetter.com/blog/2011/04/21/accelerate-site-content-delivery-network/">offloading most of my site&#8217;s static files to a content delivery network (CDN)</a> is giving me the performance I want to see.</p>
<p>Related posts:<ol>
<li><a href='http://www.alwaysgetbetter.com/blog/2012/01/30/setting-wordpress-nginx-fastcgi/' rel='bookmark' title='Setting up WordPress with nginx and FastCGI'>Setting up WordPress with nginx and FastCGI</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AlwaysGetBetter/~4/repMQOze3cg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2011/12/20/fastcgi-nginx-performance-vm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.alwaysgetbetter.com/blog/2011/12/20/fastcgi-nginx-performance-vm/</feedburner:origLink></item>
		<item>
		<title>Node.js 0.6 Released</title>
		<link>http://feedproxy.google.com/~r/AlwaysGetBetter/~3/c4E52Er3Yeg/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2011/11/07/nodejs-06-released/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 10:00:32 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Node.js]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[node.js]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=457</guid>
		<description><![CDATA[The Node.js team has released version 0.6. Although much of the core was re-written, the most noteworthy change has to be the support for native Windows installation. Whereas previously it was possible to run node.js on Windows using Cygwin, the native compilation means its performance will be comparable to Linux equivalents. Other important improvements include [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>The Node.js team has released version 0.6. Although much of the core was re-written, the most noteworthy change has to be the support for native Windows installation. Whereas previously it was possible to run node.js on Windows using Cygwin, the native compilation means its performance will be comparable to Linux equivalents.</p>
<p>Other important improvements include upgrading of the V8 engine and multi-process load balancing. Much more information can be found on the <a href="http://blog.nodejs.org/2011/11/05/node-v0-6-0/">node blog</a>.</p>
<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/AlwaysGetBetter/~4/c4E52Er3Yeg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2011/11/07/nodejs-06-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwaysgetbetter.com/blog/2011/11/07/nodejs-06-released/</feedburner:origLink></item>
		<item>
		<title>Multiple Development Environments</title>
		<link>http://feedproxy.google.com/~r/AlwaysGetBetter/~3/C2UNrLDDk3o/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2011/11/04/multiple-development-environments/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 01:19:42 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[efficiency]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[planning]]></category>
		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=454</guid>
		<description><![CDATA[Hopefully when you do web work, you&#8217;re not developing code on the same server your users are accessing. Most organizations have at least some kind of separation for their development and production code, but it&#8217;s possible to go far further. Separating environments allows you to achieve multiple threads of continuous integration for all kinds of [...]
Related posts:<ol>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/05/09/accessing-configuration-parameters-play-frameworks-template-engine/' rel='bookmark' title='Accessing Configuration Parameters using Play Framework&#8217;s Template Engine'>Accessing Configuration Parameters using Play Framework&#8217;s Template Engine</a></li>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/08/02/windows-azure-thoughts-months/' rel='bookmark' title='Windows Azure Thoughts &#8211; First Six Months'>Windows Azure Thoughts &#8211; First Six Months</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hopefully when you do web work, you&#8217;re not developing code on the same server your users are accessing. Most organizations have at least some kind of separation for their development and production code, but it&#8217;s possible to go far further. Separating environments allows you to achieve <a href="http://www.alwaysgetbetter.com/blog/2011/04/22/rely-continuous-integration/">multiple threads of continuous integration</a> for all kinds of cool.</p>
<p>These normally break down as follows:</p>
<p><strong>Development</strong><br />
Working code copy. Changes made by developers are deployed here so integration and features can be tested. This environment is rapidly updated and contains the most recent version of the application.</p>
<p><strong>Quality Assurance (QA)</strong><br />
Not all companies will have this. Environment for quality assurance; this provides a less frequently changed version of the application which testers can perform checks against. This allows reporting on a common revision so developers know whether particular issues found by testers has already been corrected in the development code.</p>
<p><strong>Staging/Release Candidate</strong><br />
This is the release candidate, and this environment is normally a mirror of the production environment. The staging area contains the &#8220;next&#8221; version of the application and is used for final stress testing and client/manager approvals before going live.</p>
<p><strong>Production</strong><br />
This is the currently released version of the application, accessible to the client/end users. This version preferably does not change except for during scheduled releases. <a href="http://www.alwaysgetbetter.com/blog/2011/03/03/displaying-productiononly-markup-rails/">There may be differences in the production environment</a> but generally it should be the same as the staging environment.</p>
<p>Having separation between the different environments is not tricky, but managing your data environment can be. There are, of course, <a href="http://www.alwaysgetbetter.com/blog/2011/04/20/database-migrations/">all kinds of ways to solve the problem</a>.</p>
<p>Related posts:<ol>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/05/09/accessing-configuration-parameters-play-frameworks-template-engine/' rel='bookmark' title='Accessing Configuration Parameters using Play Framework&#8217;s Template Engine'>Accessing Configuration Parameters using Play Framework&#8217;s Template Engine</a></li>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/08/02/windows-azure-thoughts-months/' rel='bookmark' title='Windows Azure Thoughts &#8211; First Six Months'>Windows Azure Thoughts &#8211; First Six Months</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AlwaysGetBetter/~4/C2UNrLDDk3o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2011/11/04/multiple-development-environments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwaysgetbetter.com/blog/2011/11/04/multiple-development-environments/</feedburner:origLink></item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: alwaysgetbetter.com @ 2012-05-01 05:03:00 -->

