<?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 Jan 2012 12:00:17 +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>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>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/04/09/memcached-session-handler/' rel='bookmark' title='Memcached as Session Handler'>Memcached as Session Handler</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>
<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>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>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/04/09/memcached-session-handler/' rel='bookmark' title='Memcached as Session Handler'>Memcached as Session Handler</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 [...]
Related posts:<ol>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/04/28/pintsized-mobile-devices/' rel='bookmark' title='Pint-Sized Mobile Devices'>Pint-Sized Mobile Devices</a></li>
</ol>]]></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>Related posts:<ol>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/04/28/pintsized-mobile-devices/' rel='bookmark' title='Pint-Sized Mobile Devices'>Pint-Sized Mobile Devices</a></li>
</ol></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>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/04/12/performance-tuning-apache/' rel='bookmark' title='Performance Tuning Apache'>Performance Tuning Apache</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>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/04/12/performance-tuning-apache/' rel='bookmark' title='Performance Tuning Apache'>Performance Tuning Apache</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>0</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/04/25/ensure-sla-multiple-web-role-instances-windows-azure/' rel='bookmark' title='Ensure SLA with Multiple Web Role Instances on Windows Azure'>Ensure SLA with Multiple Web Role Instances on Windows Azure</a></li>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/04/22/rely-continuous-integration/' rel='bookmark' title='Rely on Continuous Integration'>Rely on Continuous Integration</a></li>
<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>
</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/04/25/ensure-sla-multiple-web-role-instances-windows-azure/' rel='bookmark' title='Ensure SLA with Multiple Web Role Instances on Windows Azure'>Ensure SLA with Multiple Web Role Instances on Windows Azure</a></li>
<li><a href='http://www.alwaysgetbetter.com/blog/2011/04/22/rely-continuous-integration/' rel='bookmark' title='Rely on Continuous Integration'>Rely on Continuous Integration</a></li>
<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>
</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>
		<item>
		<title>Adobe Aquires Typekit</title>
		<link>http://feedproxy.google.com/~r/AlwaysGetBetter/~3/70LY5xGwNb0/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2011/10/03/adobe-aquires-typekit/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 18:17:23 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=452</guid>
		<description><![CDATA[Today Adobe announced its acquisition of Typekit, a web font hosting service that allows designers to use any typeface with their sites rather than relying on standard &#8220;safe&#8221; font families. This is an interesting development. Adobe&#8217;s Flash player already supports proprietary fonts, which suggests that the company is looking at alternate technologies for its future [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Today Adobe announced its acquisition of Typekit, a web font hosting service that allows designers to use any typeface with their sites rather than relying on standard &#8220;safe&#8221; font families.</p>
<p>This is an interesting development. Adobe&#8217;s Flash player already supports proprietary fonts, which suggests that the company is looking at alternate technologies for its future development. Obviously Flash will remain relevant for more time to come, but as competitors increasingly jump onto the HTML5 bandwagon, Adobe is wise to increase its arsenal of standards-compliant technology.</p>
<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/AlwaysGetBetter/~4/70LY5xGwNb0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2011/10/03/adobe-aquires-typekit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwaysgetbetter.com/blog/2011/10/03/adobe-aquires-typekit/</feedburner:origLink></item>
		<item>
		<title>How to Get Recommendations on LinkedIn</title>
		<link>http://feedproxy.google.com/~r/AlwaysGetBetter/~3/vh5L7u-GqW0/</link>
		<comments>http://www.alwaysgetbetter.com/blog/2011/08/09/recommendations-linkedin/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 00:58:51 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Social Media]]></category>

		<guid isPermaLink="false">http://www.alwaysgetbetter.com/blog/?p=445</guid>
		<description><![CDATA[photo credit: Orin Zebest Used properly, LinkedIn is an incredible tool for finding new opportunities and connecting with potential employers. As your network grows over time and people move on to bigger and better things, the connections you make in the early days can easily be worth hundreds of thousands of dollars in terms of [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<div class=alignright><a href="http://www.flickr.com/photos/33917831@N00/159744546/" title="Mr. Pumpkin and Mr. Apple" target="_blank"><img src="http://farm1.static.flickr.com/65/159744546_d1ce14b81b_m.jpg" alt="Mr. Pumpkin and Mr. Apple" 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/33917831@N00/159744546/" title="Orin Zebest" target="_blank">Orin Zebest</a></small></div>
<p>Used properly, LinkedIn is an incredible tool for finding new opportunities and connecting with potential employers. As your network grows over time and people move on to bigger and better things, the connections you make in the early days can easily be worth hundreds of thousands of dollars in terms of salary and other business opportunities.</p>
<p>LinkedIn has three things going for it:</p>
<ol>
<li>A thorough resume builder that is intuitive and begs to be completed</li>
<li>An easy way to find and connect to professional colleagues</li>
<li>Peer recommendations &#8211; <strong>this is what makes LinkedIn valuable</strong></li>
</ol>
<p>People who compare LinkedIn, Twitter, Google+ and Facebook are <a href="http://www.alwaysgetbetter.com/blog/2009/04/06/twitter-overtake-facebook/">missing the point</a>. Users of each network are seeking different experiences, and LinkedIn serves an excellent purpose when used &#8220;properly&#8221; as a networking tool.</p>
<p>Beyond giving a plain resume (which is, by its very nature, more detailed and relevant than most of <a href="http://www.alwaysgetbetter.com/blog/2010/06/02/resumes-alphabet-soup/">the bad paper resumes I see</a> day-to-day), LinkedIn&#8217;s user recommendations option gives potential employers a more organic view into what it would be like working with you, as seen by your colleagues.</p>
<p>There are a lot of elements that go into a good recommendation, but the goal should be to strike a balance between supervisor, co-worker and subordinate recommendations. For example, your direct boss may say you&#8217;re an excellent manager, but what about the people reporting to you? A vote of confidence from all levels gives a much clearer picture than a potentially biased recommendation from a single source.</p>
<p>The beauty of recommendations is that you must receive them from people connected to you, which means requesting them in some way. If you don&#8217;t have any recommendations already, how do you start?</p>
<p>The easiest way to get someone to write a recommendation for you is by writing one for them. Yes, you can nudge the person, officially request a recommendation, bug them in person, etc but the ego-boost someone will receive by getting a recommendation from you is, in many cases, enough incentive for them to respond in kind.</p>
<p>Don&#8217;t get upset if someone does not return your recommendation. The system only &#8220;works&#8221; when recommendations are given freely and honestly &#8211; so if you don&#8217;t truly recommend working with someone, don&#8217;t give them a review on LinkedIn. There is really no downside to this.</p>
<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/AlwaysGetBetter/~4/vh5L7u-GqW0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.alwaysgetbetter.com/blog/2011/08/09/recommendations-linkedin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.alwaysgetbetter.com/blog/2011/08/09/recommendations-linkedin/</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-01-30 07:04:40 -->

