r/programming • u/nickcraver • Feb 17 '16
Stack Overflow: The Architecture - 2016 Edition
http://nickcraver.com/blog/2016/02/17/stack-overflow-the-architecture-2016-edition/
1.7k
Upvotes
r/programming • u/nickcraver • Feb 17 '16
View all comments
Show parent comment
2
u/cicide Feb 18 '16
AWS has become pervasive, and in most cases now, when talking with people who are deploying applications, it's the only thing they look at.
We also run our own data centers and have looked at what it would take to be able to use AWS in any way (migrate completely, migrate only elastic systems, etc.). What we found was fairly enlightening.
First if you dig into the pricing, what you find is that if you plan to use a system for more than 30-40% of the time, the three year all-upfront pricing works out to be cheaper than paying by hour over that period. So right off the bat, you can make a fairly valid assumption that elasticity only saves money at a overall usage of under approximately 35% (it varies a few points up or down depending on the instance type).
With that in mind, I took one of our systems that looked like a great candidate for moving into AWS. One of our many (~40) batch worker systems (40 cores, 64GB RAM, ephemeral disk). What is nice about this example is I don't need a single server with 40 cores and 64GB, I can use 40 servers with one core or any other variation, as these systems have hundreds of workers that poll a queue for work.
My three year OPEX + CAPEX fully loaded cost for that server is approximately $9000, or about $250/month. This included all bandwidth requirements and a security stack that is quite comprehensive. If I go to AWS calculator, the best I was able to do was ~$24k over three years (all up-front reserved instance(s)), and I tried with one large instance and many small. Add into that bandwidth and the security stack I would need to build on top of the AWS instances.
Now if I can have a usage of less than 35% then pay by hour makes sense, and if I can take advantage of spot instances, I could see some breaks as well. Unfortunately, these systems run closer to 50-60% average throughout the day, so I'm past the break even point.
I think I will have some services in the future that will make sense to host on rented infrastructure (AWS, Azure, Google, whatever).
My infrastructure is a little larger than SO, and I do have a secondary hot-standby DC that doubles my cost, so in reality, that server above that I quotes out at $9000 loaded is actually $18,000 loaded when you consider I maintain a 100% Data Center copy for protection from "acts of god" events, the story changes a little, but still not enough to make a difference in the numbers.
The other benefit I have with a DC that I build is that I can ensure performance (network jitter, latency, storage performance, etc.), and in a scenario where every millisecond counts in page load times, I can't emphasize how much a difference this makes. As an example several years back, we were running on rented shared infrastructure and were seeing our server side page render times in the 600 - 900 ms. We changed nothing except moved to a self-hosted physical infrastructure and our server side page render times dropped to 350ms +/- 10ms. So not only did we cut the render time in nearly half, we also cut the variance from ~300ms to 10ms. We believe that this was wholly network congestion and latency related on the shared network in the IaaS we were using.