Amazon EC2 As A Webhost Redux
By Adrian Sutton
Back in 2007 I looked at EC2 for a web server and while it wound up being feasible it had a number of drawbacks:
Those familiar with EC2 won’t be surprised to hear that we won’t be going with the service for three reasons:
- It’s at least as expensive as the dedicated server we’d need.
- The filesystem gets reset everytime the server reboots (S3 provides a REST API to store and retrieve data, not a filesystem)
- The server gets a new IP address every time it reboots.
Since then Amazon have rolled out new services that solve problems 2 and 3 and reserved instances to help with 1. What surprises me after a couple of years running a single EC2 instance with an app that’s using S3 for storage though is just how stable it has been.
Remember that EC2’s original point in life was scalability, not running one single instance for a really long time. They’ve done tons of upgrades to their infrastructure over the last couple of years as well which normally would mean down time and migrations. You can imagine my surprise when I checked how long it’s been since the instance rebooted:
e2wiki:~# uptime 04:28:45 up 499 days, 19:14, 1 user, load average: 0.33, 0.10, 0.03
Just shy of 500 days since a reboot for any reason. I can’t say that about any other hosting service I’ve ever used so even if EC2 is more expensive, it’s seriously reliable.
Now we just need to fix the memory leak in the app we’re running on that server – it up and dies a couple of times a week. That said, the script that automatically restarts it is so effective that the external monitoring tools don’t even notice so it’s probably not worth the effort.