Saturday, May 7, 2011

Two birds with one cloud

For some time now, I've been needing to set up a new machine to do Derby development on. My current machine (a 6 year old laptop) is still running, but it's no longer powerful enough to use as a Derby development machine.

Meanwhile, I've been thinking that I really need to learn more about the cloud. I understand a lot of the principles and techniques, but I need to get more hands-on.

So, I'm going to try to set up an Amazon EC2 machine to use for Derby development. Has anybody done this before? Anything special I need to know? My plan is to set up the smallest possible Linux VM on EC2, then learn how to sign on and access it, then set up the necessary software to be able to build Derby and run the tests (Mostly that just means: Subversion, Java, JUnit, and Ant -- pretty simple).

More on this as it develops; let me know if you see any roadblocks standing in my way...

Update: So far, so good. Herewith, a few notes about stuff that was useful along the way:

  • The built-in Amazon VM has the 1.6 JRE, not the JDK. Since I wanted 1.5 anyway, I was off to the Sun website where they still make a JDK 1.5 download that installs on Linux. Thank goodness.

  • Ant was easy -- just grabbed the 1.7.1 binary from ant.apache.org

  • I needed subversion. This was a bit trickier, but I eventually figured out that sudo yum install subversion did the trick.

  • Derby still uses the 3.8.2 version of junit.jar, which happily I found without too much trouble at SourceForge.



In the end, it took me only about 2 hours to get far enough with EC2 to create a virtual machine, connect to it, load it up with Java software and with Subversion, download the Derby source code, and build it.

Tomorrow, when my head is fresh, I might even try running the Derby test suite!

Friday, May 6, 2011

Big progress in the Air France mystery!

Long-time readers of my blog will remember that I was fascinated by the mystery of Air France flight 447 in the summer of 2009.

After a long dry spell, there has been big progress in this area in the last few weeks: a multi-national team of deep sea investigators found the wreckage on the sea floor and have been bringing it up to the surface for study. The New York Times has a major article on this in this weekend's Sunday Magazine, and here's another nice article from Boston's WBUR radio station.

Over on BoingBoing, Maggie Koerth-Baker has a great interview with Mike Purcell of the Woods Hole team. Even after all the years of effort trying to narrow down where to look, the team still had a massive area to search with their robotic submarine, and searching the ocean floor with a robotic submarine is very time-consuming and detail-oriented work:

There's no data transmission back to the ship while the vehicles are in the water. We get status messages—acoustic messages that come in periodically and tell us how deep it is, latitude and longitude, just a status check to tell us whether there's problems. When the AUV gets back, it takes 45 minutes to download the data and then another half hour to process and get a good look at it. During that time the other team is switching out the battery and getting the vehicle ready to go back in. The ideal is that a vehicle is only out of the water for three hours, while somebody is looking at the data to decide where we go from here and are there things we want to look at again. When we're running three vehicles we get a data dump three times a day.


I love the picture that shows what "the find" actually looked like to the research team: just funny different-colored squiggles on a computer screen. As Purcell delicately notes, "It's good to have an experienced person looking at this stuff."

Big time congratulations to the team(s) for their breakthrough; I'm eagerly anticipating what we'll learn from the material they've been able to bring up to the surface.

New Yorker Caption Contest

Apparently, I wasn't the only one who noticed that Roger Ebert finally won an episode of the New Yorker Caption Contest.

Powerful victory by Kamsky

In chess terms, this isn't just a victory, this is an annihilation! The position gets incredibly complicated around move 22, then is rapidly resolved.

Thursday, May 5, 2011

World Chess Championship Candidates Matches begin!

This month, FIDE are holding the candidates matches, the next step in the process of choosing the next challenger to contend for the World Chess Championship against Vishy Anand. Knowing nothing, I'll go out on a limb and predict: Kamsky, Aronian, Kramnik, and Gelfand as the four winners. What's your pick?

Tuesday, May 3, 2011

Learning from the AWS outage

Generally, in computer science as in other scientific fields, we study success. We gather the best known algorithms for solving certain problems, study them, consider ways to improve them, and publish and share the best ones we can find.

However, it is just as essential, perhaps even more so, to study failure. Cryptographers analyze security breaks, to understand where the reasoning contained flaws. Wise engineers know that when you find one bug, it's worth looking around for other similar problems in the code. We do the best that we can in our designs and implementations, but, as Richard Feynman said in his report on the explosion of the space shuttle Challenger:

For a successful technology, reality must take precedence over public relations, for nature cannot be fooled.


These past weeks have provided a wonderful new opportunity for the studying of failure, in the form of the recent Amazon Web Services Elastic Block Storage re-mirroring outage. Even more interestingly, a number of organizations have published their own analyses of their own mistakes, errors, and mis-steps in using AWS EBS to build their applications.

Here's a brief selection of some of the more interesting post-mortems that I've seen so far:

  • The Amazon post mortem pointed out a number of things:

    • The basic cause of the outage was that a configuration change was made incorrectly, routing a large amount of traffic from a primary network path to a secondary one, which couldn't handle the load.

    • This caused nodes to lose connection to their replicas, and to initiate re-mirroring.

    • In order for the re-mirroring to succeed, a significant amount of extra disk storage had to be provisioned into the data center.

    • Over-provisioning resources in the data center could have prevented some of the failures: "We now understand the amount of capacity needed for large recovery events."

    • Keeping enough of the system running in order to work on the failing parts is very challenging: "Our initial attempts to bring API access online to the impacted Availability Zone centered on throttling the state propagation to avoid overwhelming the EBS control plane. ... We rapidly developed throttles that turned out to be too coarse-grained to permit the right requests to pass through and stabilize the system. Through the evening of April 22nd into the morning of April 23rd, we worked on developing finer-grain throttles"

  • The Netflix team also talked about the benefits of over-provisioning capacity. They also described the complexity of trying to perform massive online reconfiguration: "While we have tools to change individual aspects of our AWS deployment and configuration they are not currently designed to enact wholesale changes, such as moving sets of services out of a zone completely." To simulate these sorts of situations for testing, Netflix are considering replacing their "Chaos Monkey" with a "Chaos Gorilla"!

  • The Conversations Network team (a large podcasting site) described an interesting rule of thumb for determining when to initiate manual disaster recovery schemes: "Once the length of the outage exceeds the age of the backups, it makes more sense to switch to the backups. If the backups are six hours old, then after six hours of downtime, it makes sense to restart from backups." However, they also commented that they had overlooked the need to test your backups, as it turned out that once of their crucial data sets was not being backed up on the same schedule as others.

  • Bryan Cantrill of Joyent talked about the danger of adopting a cloud strategy that leads to "the concentration of load and risk in a single unit (even one that is putatively highly available)."

  • The Heroku team pointed out that not all Amazon Web Services are the same, particularly when it comes to availability: "EC2, S3, and other AWS services have grown much more stable, reliable, and performant over the four years we've been using them. EBS, unfortunately, has not improved much, and in fact has possibly gotten worse. Amazon employes some of the best infrastructure engineers in the world: if they can't make it work, then probably no one can."

  • The SimpleGeo team pointed out one of the reasons that over-provisioning is crucial: "When EBS service degradation occurred in one AZ, I suspect that customers started provisioning replacement volumes elsewhere via the AWS API. This is largely unavoidable. The only way to address this issue is through careful capacity planning -- over-provisioning isolated infrastructure so that it can absorb capacity from sub-components that might fail together. This is precisely what we do, and it's one of the reasons we love Amazon. AWS has reduced the lead time for provisioning infrastructre from weeks to minutes while simultaneously reducing costs to the point where maintaining slack capacity is feasible."



At my day job I've been spending a lot of time recently thinking about how to build reliable, dependable, scalable distributed systems. It's a big problem, and one that takes years to address.

Building distributed systems is extremely hard; building reliable high-performing highly-available systems is harder still. There is still much to learn, so Amazon are to be commended, praised, and thanked for their openness and their timely release of detailed information about the failure, which is greatly appreciated by us all.

Monday, May 2, 2011

Intel graphics problem on Ubuntu 11.04

I'm cautiously optimistic that the problems I was having with graphics crashes under Ubuntu 11.04 on my Dell Latitude 610 were caused by this bug. Ubuntu pushed the fix via Update Manager and I installed it today, so we should soon be able to tell if the system is more stable.