Cloud servers for your Perl app - Amazon's EC2 vs Mosso

user-pic

Wiki Extras for this post

The big buzz nowadays in the web-application hosting world is cloud servers. Cloud servers are virtual machines that can be deployed quickly and easily by the customer without intervention by the hosting company. They tend to live in very large data centers on clusters of hardware with specialized software designed to automatically manage the allocation, de-allocation and scaling of virtual machines.

The big player in the Cloud computing space is Amazon's Elastic Compute Cloud, or EC2. I've done a lot of work with hosting web applications on EC2 cloud servers and I find them to be extremely convenient and functional, especially compared to physical machines. They are, however, on the whole more expensive and require some specialized knowledge to manage effectively.

There is a relative newcomer to the cloud serving space, Mosso from Rackspace. Mosso's offering is quite similar to EC2, though the prices tend to be slightly cheaper.

There is very little in the way of direct comparison between EC2 and Mosso's Cloud servers and while the information about each is available, it takes some digging to get the real scoop.

In todays article, we will dig into both Amazon's EC2 and Mosso's Cloud-Servers with an eye toward the differences that will really matter to you as you try to decide which virtual server cluster upon which to deploy your Perl or Catalyst application.

Specifications

To begin with, both companies provide several options in terms of resources for your virtual machine. Amazon has small, large and extra large virtual machines with high-cpu versions of each. Mosso, on the other hand, offers 7 choices mostly based around RAM requirements.

Both companies provide information regarding what you get on each level of service. The information that is not very clear on either service, however, is how much CPU you get with each offering. I've done some research into this and it boils down to:

  • EC2's 'small' instance is approximately 1/2 of a 1 core CPU running at 2 Ghz
  • Mosso's '1024M' instance gives you 1/2 of a 1 core CPU running 2.4 Ghz

The difference here is that Mosso is only 6 cents per hour, or $44 per month, whereas EC2 is 10 cents per hour, or $72 per month. That seems like a no-brainer until you realize that Mosso only provides one gigabyte of ram at that level, whereas Amazon provides 1.7 gigabytes. Amazon also gives you much more disk space at that level. So it seems Amazon is the winner here, right? Not exactly. There are some things you need to know.

Amazon describes the IO bandwidth on their small instance using the somewhat vague term 'moderate'. What this means is that for your average web server you are probably fine, but if you intend to run a database on it, you are in for some trouble.

This brings into play one of the oddities of EC2. There are issues where, apparently in certain situations, applications are unable to properly determine amount of free RAM on your VM. This problem definitely affects MySQL and is likely to affect other databases as well. If you run into this problem, if you use a complex join (or even a simple join with a lot of records) or your database simply requires more ram than is available, you suddenly wind up dealing with a lot of disk IO.

On a physical machine this would not be much of an issue, but this is where EC2's 'moderate' IO performance becomes an extreme problem as queries that take a few seconds on a 'normal' server balloon out to 12+ minutes on your small EC2 instance. Switching to a large instance solves this problem by increasing IO performance, but at 4x the cost.

This seems to be related to how EC2 handles IO allocation and how machines are deployed in the cluster. Amazon's EBS block storage is not local (IE on the same box) to the instance (though it's performance can be fooling) so they allocate IO amounts based on what you pay. Mosso doesn't have this same IO limiting.

I have had personal experience with the MySQL / IO problem on EC2 and it is a very hard problem to track down if you don't know the above. I have not yet had any issues on Mosso, though I have only been using them for a short time.

Back to CPU, at Mosso, you get 1 full 2.4Ghz Core per 2G ram in your chosen service level. This is a linear upgrade and the cost is linear as well, so it's clear what you are getting. When you reach 16GB ram, you have run of one of the Mosso cloud machines, 8 cores at 2.4Ghz, though the cloud is still flexible enough to move your VM to a new machine in the case of hardware failure. As I understand it, both EC2 and Mosso will result in a few minutes of outage in the case of a hardware failure on the physical machine your VM was running on.

APIs and services

As the more mature option, Amazon's EC2 has a solid API offering that many companies have built upon. There are offerings such as RightScale and it's less expensive competitor Scalr, which will automatically scale your application based on current traffic and system load. These offerings are interesting when you are running a sizable site that might need that service. Perl based applications seem to be somewhat neglected in these offerings, though I suspect that if you want it enough you can make it work.

Mosso has an API as well, but it is not yet publicly released. As such, those types of services are not available. Mosso does, however, provide something called cloud-sites which provides a similar solution. I've spoken with them about this offering and while interesting, it leaves Perl in the cold insofar as it does not allow root level access, so installing Perl modules can be a problem. It'd be interesting to see a local::lib deployment there, to see if something like a Catalyst app could be deployed upon it.

Of course, none of this matters if you aren't running an application that requires a large number of servers. The vast majority of web applications I've seen tend to run from one to a small handful of machines, in which case the auto-scaling cloud-site type services of both EC2 and Mosso are irrelevant.

Storage

One place where Amazon's offering shines is in additional storage. Amazon offers EBS (Elastic Block Service) which lets you create large blocks of filesystem-level storage which can be mounted onto any instance. When configured this way, you pay per Gigabyte allocated. This is very important to those sites which require a significant amount of storage. Mosso does not offer mountable additional storage.

Mosso provides cloud-files, but this is a solution akin to web-dav or S3 in that it requires integration into your app (via an API) to access. There is a Perl interface to Cloud-files, but unless you are starting a new app, or have the luxury of making significant changes to your app prior to deployment, this won't be of much use to you.

Since there is no filesystem-level option, if you have a particularly large database or you have other filesystem storage requirements your only option is to use a larger instance with more storage. This, I think, is a significant drawback to Mosso. Fortunately, the storage provided with each Mosso server is adequate for what you are likely to need for an 'average' web app.

Bandwidth

Both Amazon's EC2 and Mosso's cloud-servers require you to pay for the bandwidth you use. In both cases, their costs are reasonable. Amazon is a bit cheaper here at $0.17 per gigabyte, compared to Mosso's $0.22. Amazon's prices drop as your bandwidth usage increases, but with the first drop at 10 Terabytes, not a lot of people are likely to notice that difference.

Interestingly, for inbound traffic, Mosso beats out Amazon with a rate of $0.08 per gigabyte to Amazon's $0.10. This can make a difference if your service takes a lot of uploads or you do a lot of content aggregation. Generally speaking, however, unless your application has a somewhat inverted traffic pattern to most sites, this won't make a huge difference for you.

IP allocation

There is one difference between cloud servers and EC2 that can be extremely important. That is that Amazon enforces a strict 5-public-ip rule. This means that your company can only have 5 dedicated public IPs, regardless of how many servers you have. Note that I did not say application, this is a per-EC2-account rule. This can be a problem if your company hosts multiple sites, or if you have other public-IP requirements (such as SSL certificates for multiple sites for example.) Mosso does not have such a restriction. At Mosso, you have one public IP for every instance you have.

Mosso also provides reverse-DNS to your own domain, which can be very important for things such as email delivery. EC2 does not provide any method to edit reverse DNS. Among other things, this makes EC2 not feasible for anything requiring outbound email delivery. You can get around this by having a non-EC2 relay host for outbound email, but in many ways requiring an external host defeats the purpose of working within the cloud in the first place.

Other differences

One of the other interesting differences between EC2 and Mosso is the 'upgrade path.' With EC2, if you find that your machine needs more resources, you don't have a ton of options outside of 'create a new larger instance and migrate to it.' There are ways to make this an easier process than an initial deployment, but it requires some know-how of EC2.

Mosso, on the other hand, has a more direct upgrade path. If you require more memory or more CPU, with Mosso you can simply upgrade your instance. The process is automated and includes a verification step so you can make sure the upgraded machine works properly before permanently disabling your smaller instance. Ultimately, though, it only requires what amounts to a VM reboot, and once that is complete you simply have what you need. This can be very appealing when you are initially rolling out an application and simply need to give your server more power as you get more users.

Another place where EC2 and Mosso differ is in server installation. Mosso behaves much more like a real machine, at least in terms of initial deployment. If I didn't know better, you could tell me that the Mosso VM was a real machine and I'd probably have believed you. Amazon's EC2 instances are a slightly different beast, though enough people have delved into AMI (Amazon Machine Instance) creation that there are now literally hundreds of options tailored to the EC2 environment.

Mosso has the advantage in cloning an existing machine, however. With Mosso it is very easy to clone an existing server into a new vm and requires very little Mosso-specific know-how. EC2 offers creation of new machines from an AMI, but you have to have worked out how to create an AMI in order to use it. Not a huge hurdle, but Mosso makes it significantly easier and that is a win in my book.

All that said, when you are talking about hosting, it almost always comes back to...

Price

Amazon's EC2 and Mosso are competitive when you get to the larger machine types, though Mosso has a slight edge in terms of CPU power. Mosso's next-to-largest offering has the same amount of CPU power as the Amazon's top-end extra-large offering at $200 less per month.

Where Mosso is really interesting, though, is in the smaller machine types. You can get a very small Mosso machine in the $11 per month range, and a fairly capable one at $22. For those testing the waters or wanting a machine for development, that's a great deal giving you a solid machine at a low price. In addition, Mosso's quick upgrade solution makes growing your machine's resources very easy.

The summary

On the whole Amazon EC2 and Mosso are very close competitors. Amazon loses out on CPU power per dollar spent, but Mosso costs a bit more per gigabyte of RAM. Mosso loses out on 'extra storage' but wins on general IO speed. Mosso has the advantage on individual server upgrades with it's instant-upgrade features, but Amazon wins on large-scale deployment because of it's API and solid auto-scaling options.

So which do you choose? If your application is particularly memory bound, requires a huge amount of disk space, or if you are at the higher end in terms of clustering requirements, Amazon's EC2 is a good solution.

If that is not the case, however, EC2 just doesn't hold up, cent for cent, against Mosso's offerings. In my opinion, the combination of lower cost, better base CPU/RAM options and a smoother upgrade path make Mosso's cloud-servers the clear winner.

Mosso gives you the ability to start with the smallest instance feasible for your web-application and the ability to upgrade without disrupting or re-deploying your system. This makes it perfect for the prototype, test, deploy, upgrade site development cycle we are all familiar with.

For most applications and services, Mosso cloud servers stand out as a great hosting option. It is good for production hosting as well as prototyping and architecture testing. It's low cost and excellent web-based management interface make it an all around good choice. When it's API is released later this year, it will be hard to think of a reason not to use Mosso for any application, regardless of it's size or complexity.

What do you think? Have you used EC2 or Mosso cloud-servers? Got comments, or feel something I wrote isn't quite right? Sound off in the comments!

No TrackBacks

TrackBack URL: http://www.catalyzed.org/mt/mt-tb.fcgi/50

12 Comments

| Leave a comment

Very nice article at a very nice time. I'm just in the process of migrating my old production server to several Rackspace Cloud (Mosso) VMs.

The ability to have very small VMs that are easy to install and maintain really made it a no-brainer. The built-in backup and upgrade methods, together with the possibility of a full Rackspace SLA is a very good offering indeed. What I also like is that they support all the popular Linux distributions.

My only problem with Mosso is their lack of servers in Europe. While EC2 has the ability to deploy a server in Europe (I think they are even supporting 2 availability zones at the moment)

Perhaps you should also evaluate SoftLayer's new cloud offering http://www.softlayer.com/cloudlayer_computing.html . It starts at 99 USD for a 1gb instance, but gives you 2ghz of processing power, comes with bundled bandwidth, allows for expansion of storage, image cloning and, the better thing, you can integrate via private LAN the cloud servers with dedicated servers hosted on their datacenters.

This is a great comparison. A factor you haven’t considered is competition for IO bandwidth in the system bus between instances on the same machine. There only one IO Bus per server and the hypervisor regulates its access (this introduces significant latency to the network and disks). This latency is consistent if all instances require low amounts of Bus IO. If one instance needs lots of IO (like a big MySQL operation) it will slow down the other instances. Maybe your Mosso instance was on a new server with no other customers (yet). Maybe your EC2 instance was on a shared server with another user that just happened to be running a big database query at the time of your test. If you don’t share your personal laptop or office desktop why share a server?

user-pic

Nice detailed comparison. It would be good to run an update every six or twelve months and see how the features and pricing evolve.

The article did not mention content delivery (Cloudfront versus Limelight) which could tip the balance for some applications.

Also note that AWS has a request process for more than five IP addresses although I have not personally tried it.

@Diego: Thanks for the pointer, I will have to investigate SoftLayer's offering.

@JP: This is true to a degree, though the EC2 problem exists on every small instance I've used and is a known problem (once you know how to look for it) Generally in VM systems there is a 'minimum' IO allocation that prevents overuse by one vm over the others. This is one of the main benefits of VMs vs. virtualhosting (multiple accounts on a single server) You are right about Mosso, though, I do not know their IO allocation policy, though I suspect since their other resources are split based on a linear slicing of the existing hardware I'd expect IO to be similar.

@John: Thanks for pointing out the 'request an IP' process. I've heard of this also, but the way it's worded makes it seem like you have to have a pretty good reason for needing more. I wonder how smooth that process really is.

The Hypervisor wants to evenly divide IO resources to prevent overuse by any one instance but it is imperfect (the server wasn’t designed to be shared). Customers that have migrated to us from virtual server clouds complain that response times on shared servers are unreliable.

Great article Jay!

I'll keep this in reference when I need to consider CC. It's nice to see Amazon has some competition to give cloud computing a different "view".

user-pic

On the subject of I/O:

All of the physical storage inside of a Cloud Server is a 4 drive RAID-10 configuration and is presented to you as a single volume. In an EC2 server you get individual hard drives. Unless you do something exotic with your EC2 install, you are reading and writing from a single drive. Numerous other instances on the same physical host also do ALL reads and writes to the same drive at the same time you are trying to use it.

On Cloud Server reads and writes for your server as well as all other servers sharing the same physical host are divided among the various devices in the raid array. This is why no matter how many times you measure I/O performance head-to-head, the Cloud Server consistently outperforms the equivalent EC2 instance. This is especially true for the small server sizes.

The performance of the hardware raid controller used by the Cloud Server host is substantially better than the performance of your typical on-board SATA controller that you'll find on an EC2 host.

Because the servers all run RAID-10, the host fail half as frequently due to hard drive failure compared to an EC2 instance. Plus, if the host server reboots, the data will still be there for you. It's gone after a crash with EC2.

PS: New brand. Now Mosso == Rackspace Cloud

This is purely anecdotal:

We've never had problems with our EC2 instances and deployments.

We have had problems with our one Mosso experience.

From the developers I work with, Amazon is the stable, but somewhat ugly service, while Mosso is a bit glitzier, cheaper, but not as reliable.

Totally unscientific.. yes. But my 2 cents.

I am glad however that there will be good competition to force downward price pressure.

Hey Jay! Long time no hear. I hope things are going well for you and the fam.

Really great article. Was thinking about going with Amazon for some smallish stuff, but I'm gonna go look at Rackspace now. Thanks for putting all that information together!

My 1,5 cents on Amazon EC2 vs Rackspace Cloud Servers.


There was a time when there was only one (known) IaaS provider, but competition has arrived, targeting different people with different needs...

Indeed Amazon has a lot more features, but it happens to be that I need none of it, like probably any small-medium business needs. And that seems to be the target of Cloud Servers.

I've been hosting my personal and company demo sites on both IaaS providers and doing some (un-professional) performance tests with installs of ubuntu at both platforms too...

Read my 8 points and 4 drawbackes here...
http://www.cloud-y.com/index.php/iaas-cloud-infrastructure/26-amazon-ec2-vs-rackspace-cloud-servers

Leave a comment

All comments are moderated. Spammers don't waste your time

Sponsored By


Ionzero: Rescue your dev project.
OpenID accepted here Learn more about OpenID

Following

Not following anyone

Note to spammers: all comments are moderated. Don't waste your time