Author Archive

Video: Node.js by Ryan Dahl

I recently read about “Node.js might be the most exciting single piece of software in the current JavaScript universe.” and “Node’s goal is to provide an easy way to build scalable network programs.” Sounds great. With this talk from Ryan Dahl, I’ve got a bigger picture:

1 Comment

Cached json (or xml) view with CakePHP

While implementing caching for view as descriped in the cookbook i stumbled upon some glitches:

First I found out the best way to avoid problems with routing urls beeing not cached - especially when using Router::mapResources() - is to enable the caching per action in the controller like this:

function view($id = null) {
$this->cacheAction = "10 minutes";
// more stuff
}

The next problem was that cached views don't retain document mime type (xml, json, etc.). The first request works correctly (uncached request), but the second request will come back as text/html. You can find a more detailed description of the problem here.

I got an advice to enable callbacks for my views but that slows down and defeats the purpose of the cache. My approach now is to use a layout like this:

PHP:
  1. <cake:nocache><?php
  2. configure::write('debug',0); // surpress all debug output on json views
  3. header('Content-type: text/x-json');
  4. ?></cake:nocache><?php echo $content_for_layout; ?>

With the header('Content-type: text/x-json'); embedded in the nocache tags, it works fast and returns the correct mime type.

  • Development-Server XDebug enabled, APC enabled, View cache disabled:
    Requests per second: 1.64 [#/sec]
  • Development-Server XDebug enabled, APC enabled, View cache enabled (files):
    Requests per second: 29.04 [#/sec]
  • Development-Server XDebug disabled, APC enabled, View cache enabled (files):
    Requests per second: 95.66 [#/sec]

Further reading
8 Ways to Speed Up the Performance of CakePHP Apps.
Store View Cache in APC or Memcached.

1 Comment

Is Chromium OS the perfect netbook OS?

After Googles launch of their own programming language "go" (which looks like a polished c++ meets pyhton) the next big thing is Googles attempt to re-think what operating systems (targeting netbooks) should be: Google Chromium OS. I don't yet follow the idea of no native apps "on the desktop". So I'm exited about Apple's plan for this netbook (or tablet-) market. As a developer I welcome every platform that allows users to access webapps in a more convenience way. And this is pretty much the best attempt for the old idea of a "network only computer": Network Computer Reloaded.

No Comments

The Animated Google Story

A quick look back at the Google story over the last 11 years. From Stanford to Mountain View and around the world, featuring many different products, starting with BackRub (Search) up to Google Wave, StreetView and Chrome.

No Comments

Getting Git

After reading ebooks, watching screencasts and working through some tutorials trying to get a grip on git, I found this slide that made me understand. Great! Thanks, Scott Chacon.

Another helpfull resource is: Understanding Git Conceptually

No Comments

Social Media Revolution

Is social media a fad? Or is it the biggest shift since the Industrial Revolution?

No Comments

EC2 Reserved Instances

With "Reserved Instances" Amazon introduced an additional pricing option for EC2 that gives an option to make a one-time payment for an instance to reserve capacity and further reduce hourly usage charges. You may look up the details at: aws.amazon.com/ec2/#pricing.

I have made a rough comparison for the classic "on demand" small instance against the new reserved instance:

On Demand Instance:
$0 + (365*24*$0,10) = $876/year = $73/month

Reserved Instance 1year:
$325 + (365*24*$0,03) = $588/year = $50/month
Saves you $288/year or $24/month.

Reserved Instance 3years:
$500 + (3*365*24*$0,03) = $1288/3years = $430/year = $36/month
Saves you 446 $/year or 37$/month.

Here's the offical FAQ on using Reserved Instances. And here's a funny but critically blog post about the "single commandline that can costs you losts of money". I think Marc Musings is right and I wish that Amazon would improve this because I had the same bad emotions with this "new API feature". It would basically a good idea to have alerts and/or limits for charges, instances and traffic.

Can't wait for reserved Instances to be available for the EU region... "in the near future" as Amazon promised... Happy emotions when spending big money with ec2-purchase-reserved-instances-offering!

UPDATE 09-08-21: New Lower Prices for Amazon EC2 Reserved Instances and I'm also happy to see that one of my EC2 instance hit the 500 days uptime mark.

, ,

No Comments