How fast does Amazon’s EC2 update its Elastic IP mappings?

I’ve been gathering data. I’m about to start doing a lot of work on EC2. I am curious about RightScale’s suggested upgrade technique, and also the criticism that appeared in the comments:

Once we’re confident in the new test version, we simply reassign the EIP 172.168.5.6 to the www_rel3 instance and shortly thereafter all users accessing the site are now receiving data packets from the new release. Remember, as long as the www_rel2 is available, you can easily swap back and forth between www_rel2 and www_rel3 until you are completely satisfied with the new site. And when you’re ready, you can terminate the old www_rel2 instance. See diagram below.

In the comments, Ajay says:

I’ve tried this technique in practice for upgrading a server on a site with live traffic and I’ve found that it does not work as you describe. Using your terminology, this is what I’ve experienced:

1) I assign the live EIP to www_rel3

2) For 75 seconds, live traffic is still directed to www_rel2

3) Then for 75 seconds after that, requests to http://www.rightscale.com go NOWHERE. Users get an error saying the browser cannot be found

4) Finally, traffic started getting routed to www_rel3, as expected.

The problem is part 3. I had always assumed that the switch was clean–either traffic would go to the old server or the new server, but it wouldn’t get lost.

Have you experienced that? How do you handle upgrades?

I am curious how long such switching really takes, on average.

2 Responses to “How fast does Amazon’s EC2 update its Elastic IP mappings?”

  1. Michael Fairchild Says:

    There are a few alternate options that should allow a handoff without dropping clients:

    If you don’t mind having another instance up to run haproxy you can follow this technique
    http://www.igvita.com/2008/12/02/zero-downtime-restarts-with-haproxy/
    It was written before ELB was around, but you could do similar approach with ELB.

    Or, you could use DNS trickery for a smooth handoff
    http://www.igvita.com/2008/09/22/high-performance-dns-for-the-cloud/

  2. lawrence Says:

    Thanks, Michael. That is good info. I found Igvita to be packed with info.

Leave a Reply