Physical Servers vs. Cloud Providers
When you’re architecting a solution for some kind of business or infrastructure problem, there are many things to consider: base load, peak load, growth rate, skill levels and specialties of the tech people your client has available to them, and much more. Your solution (whether ‘cloud,’ physical, or both) needs to give the maximum amount of value for the money you’re given to play with.
Let’s take a look at some advantages and disadvantages of both cloud (Amazon AWS EC2) and physical servers.
There’s nothing wrong with virtual/’cloud’ servers for quick experimentation and fun. However, for larger projects where CPU/Network-stack/Disk-IO performance is critical, I often recommend against them, which surprises clients who have only heard IT consultants trumpeting the “Cloud is best for everything” mantra.
The performance/price ratio of modern physical servers can inspire wonder at why some of these new-age startups spend $30,000/month on a few VMs when they can easily get several times the performance for a quarter of the price by running physical machines that have
- lower total cost of ownership
- better price/performance ratios
- higher individual reliability
- predictable performance
- similar setup time as VMs
- better mean-time-to-failure than most best-effort cloud VMs
A Quick Pricing Example (Q2 2016)
To give you a concrete example, I just did a quick comparison of current Amazon AWS EC2 price/performance versus one of the physical machine providers (soyoustart.com) mentioned in the “Where to get a Cloud Server” post.
Amazon’s m3.2xlarge instance costs about $383.04 per month. A decent server at soyoustart is the E5-SAT-2, which actually has better performance than the m3.2xlarge already, for $95 per month. But let’s say you have a budget of exactly $400. Here’s what you could do with it:
Provider | CPU | RAM | Price |
1x Amazon AWS, m3.2xlarge instance | 8vCPU | 30 GB | $383/month |
4x soyoustart E5-SAT-2 servers | 24 Cores, 48 Threads (Intel Xeon E5 1650) | 256 GB | $380/month |
In this case, you’re getting over four times the raw performance for the same price (one AWS EC2 instance vs. four physical servers, each of which is more powerful than the EC2 instance). “More” is not necessarily always “better,” though, so let’s look at some of the important factors:
Provisioning Speed
In my experience ‘provisioning’ a new physical server takes between 5 and 15 minutes (time from ordering the server until I have an OS running that can accept SSH connections). To confirm this, I just spun up a new EC2 instance: from provisioning to being able to log in via SSH, the AWS instance took about 3 minutes. The “fast start-up time advantage” of a VM has never been an advantage for me, although for some this might be important.
Performance
Physical machines win both in terms of raw capacity (RAM/CPU for the price) and predictability (you know you’re the only one using those physical resources, so you won’t experience sudden insane disk or network I/O latency). You also know exactly what ‘one core’ means. On virtual machines, ‘one vCPU’ can mean vastly different things in terms of actual performance, even on two VMs in the same datacenter or availability zone.
AutoScaling/Scale-Down
This is where ‘cloud’ services like AWS and OpenStack really shine. The ability to automatically spawn or terminate instances based on current load is the major advantage of cloud providers. With physical machine, you generally have to commit to at least a month of use on a rented server, so scaling back down is much easier on a cloud instance.
Calculating the Answer for your own Business
Even if you’re growing quickly, you generally have some idea of what your base load is (the constant/minimum amount of load from your users using your service) and what your peak load is (the highest levels of demand on your service in a particular period). Most services have something that looks like a sine wave: predictably low when it’s nighttime in their primary market, predictably high during daytime.
Each business has to make these calculations themselves:
- are physical servers that can handle peak load cheaper to rent than cloud instances that scale up and down (e.g. an average day where you need 8 hours of N number of instance A’s at price Y, and 16 hours of O number of instance B’s at price Z)?
- do we have someone who is willing to order a new physical server and fire off the setup scripts at 4 in the morning when there’s a sudden influx of new users? Does it cost less to hire someone who is willing to do that, than the money we save by using physical servers?
Looking past the marketing hype and asking the right questions can mean the difference between having the right infrastructure and going out of business.
Final Thoughts: Asking the right Questions
Much like with programming languages, the question is not “which is better — physical or cloud?” The right way to think about this is to take your current situation into account and use real pricing and metrics to choose the one that’s better for you, right now. Based on actual data.