At Sokrati we are very dedicated users of Amazon EC2. We swear by it and have a complete faith in their offering. Amazon EC2 has never let us down and has been sticking to their word of 99% uptime.
Many of my skills of Systems Administration I picked up during my 3 years stint with Amazon. I wonder whose idea it was but the complete decentralization prompts every Software Engineer to think through their hosts and procedures. It is at Amazon I learnt the importance of load-balancing, fault tolerance, datacenter redundancies, backup and those myriads of system maintenance that folks in other companies just take it for granted.
All of the infrastructure provided by Amazon EC2 is very much everything a company needs to run its systems with hardly any downtime. But are we using it right? Is it worth the money we are spending on it? When was the last time you checked the EC2 billing? Is there an alternative?
Are you using Amazon EC2 right?
EC2 provides a very convenient way to bring up boxes and shut them down when you are done using it. They have a very good API to achieve the same. But do we end up shutting them down?
In a true cloud-sense machines are to be used when work is to be done and then shutdown after completion. Amazon bills you by the hours of usage. Though this paradigm seems very simple to understand and seems efficient in reality it aint so practical. When you bring up a box for usage you will have to configure it before it becomes usable. There are a couple of ways of doing this:
- You use Amazon AMIs: You create an image of the host with all the configuration you intend to have. When the need arises you bring them up, get the work down and then shut them out. The only drawback here is that the images have to be kept up-to-date otherwise the stale software puts your system in jeopardy. I donno about you guys but this is a constant pain for us and makes it prohibitive to use on an "on-demand" basis.
- You use a central system configuration tool such as Puppet or Cfengine. Here after the host is brought up it talks to a system management server and gets itself in sync and then becomes operational.
Apart from the above you need a way to bring up a box and to assign it work. This needs a major shift in the way your software is designed. We were able to solve this in Sokrati using a
Distributed Scheduler. How many of us use EC2 in an effective way so that there are no idle cycles. We mostly end up bringing up boxes and keeping them up and running for time immemorial.
When was the last time you checked an EC2 billing statement. I am not sure about you but it is so scary that I stopped looking at it. In this constant urge to keep pumping more software and more muscle we lose track of how much we are paying for the same. If you look at the bill it is divided into the following components:
- Elastic Block Storage: This is inevitable if you want data to be persistent after a crash
- S3: Inevitable as AMIs are stored on S3. You may also be using it for data backup
- Data Transfer: The bandwidth that you are consuming. Again split across External & Internal. Internal is free but external is not. I am not sure about how they charge inter-datacenter traffic.
- Load-balancer: A necessity for balancing traffic and fault tolerance.
- Finally the host itself. Small, Medium, Large, Extra Large
And then there is the concept of Reserved Instances which puts you in a contract for a certain number of months.
Alternatives?
We recently began to dabble with
Hetzner with a rhetoric question "do I really care where my boxes are located?". This is a hosting service provider located in Germany. And I am glad to say I am surprised. They have an offering of virtual machines, dedicated hosts and collocation services. There are many necessary solutions that Amazon provides where Hetzner doesn't even come close. Here I list them down and also provide workable solutions.
Host Comparison
The Hetzner hosts are far superior and far cheaper than that of Amazon EC2. It surprises me how they are able to even provide them. I spoke to a couple of Indian datacenters asking them to match the price and they either don't call me back or in some instances they outrightly have told me that their price is unbeatable.
The comparison is not necessarily apples to apples but I am picking up the most commonly used instance of Amazon EC2 (a medium 32 bit host) and a very large host of Hetzner to show you how way off Amazon EC2 is. Secondly I am also assuming at this time that you run your EC2 instance permanently, similar to the way you would run a dedicated Hetzner Host.
Type
|
RAM
(GB)
|
Hard Disk
(GB)
|
CPU
|
#CPUs
|
Per Month
(USD)
|
Setup Cost
(USD)
|
Discounted
Yearly Cost
(USD)
|
Discounted
Yearly Cost
(INR)
|
EC2 Medium
|
1.8
|
335
|
Intel(R) Xeon(R) CPU
|
2
|
140
|
0
|
1680
|
83,999.15
|
EC2 Medium
(1 yr reserved)
|
1.8
|
335
|
Intel(R) Xeon(R) CPU
|
2
|
80
|
138
(per yr)
|
1098
|
56,238.48
|
Hetzner EX5 |
24
|
2 * 700
|
Intel(R) Core(TM) i7 CPU
920 @ 2.67GHz
|
7
|
78.25
|
65
(1time)
|
813
|
41,641.00
|
- EC2 hosts are virtual and Hetzner hosts are dedicated physical machines
- Hetzner costs have 19%VAT included. And if you are billing unit is out of Germany you avail a 19% reduction i.e. you don't have to pay VAT.
- Discounted Yearly Cost includes the Setup fee + 12 * monthly fee. And for Hetzner 19% VAT is excluded.
You can clearly see how much better Hetzner is!
EC2 has Images!
Yep EC2 works on AMIs and is on Virtual Hosts and hence images is a great resource. Hetzner has no such thing. Infact Hetzner boxes are plain vanila boxes booted up with a specific flavor of the OS you want and that's it.
You can easily use Puppet (a product of Puppet Labs) to configure your hosts as per your requirements.
EC2 provides easy scaling
Hetzner boxes have to be requested as opposed to EC2 hosts. It is manually provisioned in their rack space and then allotted to you. It usually takes 1-2 days if the requested configuration is available. And if you caught them over a weekend then 3 days.
To handle this I have started requesting 3 more than required. The billing starts after the first month. So you get a month after the host has been launched to decide whether you need it or not. Post 1 month the setup fee and the monthly billing gets effective.
EC2 has Load-balancing
Hetzner doen't provide load-balancing software or hardware and they aren't going to offer it. We have bypassed this by using HAProxy and Amazon EC2's load-balancer. Since Hetzner is in Germany we launched two hosts of Amazon EC2 in Ireland on which we installed HAProxy. HAProxy on these hosts know about the Hetzner hosts and provide load-balancing on them. These two HAProxies are behind the Amazon's Load Balancer in the cloud which provides fault-tolerance. Both the HAProxy are peers and operate in the same fashion. This adds an extra hop but is a very workable solution as opposed to doing your own load-balancer fault-tolerance.
Amazon EC2 LBs cannot manage hosts that are outside their datacenter. And hence this workaround.
EC2 has EBS
Honestly with the quality and quantity of the hard-drives that Hetzner is providing I doubt if we need more disk space. The Hetzner drives are RAID so they have an easy backup and are crash resistent. I am sure if you call Hetzner folks and ask for an extra drive on your host they will be able to provide you one for an extra cost.
EC2 is in Singapore too
Hetzner is a Germany based provider. For India Amazon EC2 Singapore is the closest datacenter. Latencies are slightly more from India.
- Ping time India -> EC2 Singapore Host: 157 ms
- Ping time India -> Hetzner Germany Host: 199 ms
EC2 has S3
Yep and chances are you may still want to use it! Hetzner has a backup solution but I am not sure how good it is.
Conclusion
Going by the lines of my forceful high-school teacher, I conclude by saying please make an informed decision regarding your service provider. We are a startup and bleeding money is in short killing yourself. And no I don't work for Hetzner, I am a hardcore Sokratian!
If you'd like any specific information about either please leave a note and I will try to answer them.