EC2 t1.micro, PHP Code Tuning and Dr. Bronner
As the summer comes to an end, I thought I would talk about a few of the things I've found joyful this season. So what do cloud computing, code tuning and soap have in common? All three are about clean solutions, good ingredients, and they all make me joyful. Yes, even the soap - that doesn't make me strange, just clean.
For the non technical readers, you can skip down to the soap at the bottom and avoid all the jargon and programmer centric bits in the first two.
Amazon EC2 t1.micro Instances
A few days ago Amazon announced micro EC2 instances that fall into the $15-20/month USD price range. This gives you a dedicated cloud server running your favourite flavour of Linux with a modest amount of CPU and RAM. I say modest because it's smaller than the other EC2 offerings not because it's too small to be useful. I see these as strong competition to the $20/month shared hosting offerings that a plethora of people use. You require UNIX skills (or a willingness to research, learn and try things out) but you can literally go from zero to making your first mistakes and back again on a brand new instance in mere minutes.
Contrast this to your first experience testing out Linux on your desktop computer, fumbling around with CDs or installation media, grappling with obscure partitioning and disk layout issues (this comment probably dates me). These new instances are, in my humble opinion, an incredible way to learn and experiement with LAMP, Linux and web services in general. For old hands like me, it's a joy to tinker with experimental networks, software and, at this price, even cluster computing. You can have a five node cluster running Grid Engine for around $75/month.
PHP Code Tuning and Care
I'm a little bit of an optimization and performance nut. I mean that in a good way, not as an obsession over random micro-benchmarks early during development. Optimization is always a temptating for me during development; a little bit of architectural thinking at the start to steer clear of scaling bottlenecks coupled with beating down slow spots in later development turns out to be a great formula for me. The first part involves good knowledge of your target language, environment and application - there are no substitutes for good design up front. The latter is greatly helped by good tools that give you insight into where to focus your optimization efforts and tell if they are paying off.
For PHP, thankfully, there are some really great tools. Building on the incredible work done on C and C++ with Valgrind, the Xdebug PHP extension spits out cachegrind compatible profiles of running scripts. You turn on the extension, tell it to start profiling anywhere in your application and save the traces to a file. After you get them you can use KCachegrind to delve into the profiles and find out exactly where your application is slow. Use this in a profile, tweak code, test, profile cycle and you can make solid progress towards removing many bottlenecks in your application. Things you can't beat out of the profile might need some reengineering but at least you will now have the knowledge to make the right changes. All these tools work easily on Linux and OSX (and with a little more work, on Windows) so you have no excuse not to understand what is going on in your code or why it' slow anymore.
Click on the profile image above for a window full of profile and call graph goodness from one of my other pet projects.
Dr. Bronner - King of Soap
Castille soap available in a variety of scrumptious flavours (peppermint is my favourite) and wrapped in the most interesting labels of any soap anywhere, both the bar and liquid soap are superb quality. Made with high quality coconut and palm oils and lye, they make great hand, body and even in a pinch, shampoo. Not only do you get good soap but the labels always make me smile. They are a little wacky but full of such obvious well wishing and Leary-esque statements that I can't resist reading them each time I unwrap a bar.
You have to respect a man that makes good soap and preaches world harmony. Kudos to his family for continuing the efforts after his death and even going fully Organic.
ENJOY ONLY 2 COSMETICS, enough sleep 4 Dr. Bronner's "Magic Soap" to clean body-mind-soul-spirit instantly uniting One! All-One! Absolute cleanliness is Godliness! … To dream the impossible dream! To reach that unreachable star! 41 AII-One, All-One we are! To fight that unbeatable foe! To go where the brave dare not go! To right the unrightable wrong! Emanuel Bronner
I know I find those inspiring words when showering or battling stubborn code.

