Those Quadruple Extra Large instances are $2/hr. The 24 of them used for postgres would be like $35k/month just for that part alone. I'm guessing they are spending >$100k/month on just hosting 100+ instances. Not to mention disk, bandwidth, dns, s3, public ip's, etc.
At ~35k/mo (they may have a deal here, though), that's the fully loaded headcount of 2-3 FTE devops people. In return, they get EC2's turnaround time on new instances. Not to mention that they're constantly pushing images to S3.
I would agree that EC2 isn't a no-brainer decision here, but it seems like a reasonable one.
Every time I see numbers like this, I wonder why everyone seems to think you have to use AWS or else you've failed at scaling.
They could run their operation for 10-20% of their AWS costs at a dedicated server host. And everything would be much, much faster.
i use aws/cloud like i use spare tires. i only use them in emergencies. why? the price, i don't care much. it's just the performance gain going from aws network i/o to directly-attached SSD/SAS i/o is almost night and day
I noticed this, too. This statement stood out to me in particular:
> Our main shard cluster involves 12 Quadruple Extra-Large memory instances… We’ve found that Amazon’s network disk system (EBS) doesn’t support enough disk seeks per second, so having all of our working set in memory is extremely important.
Using AWS is not just for its instances. S3 is a big factor. It's hard to replicate the S3 functionality in your own hosting without much more effort and cost. Granted that the AWS instances can be used more efficiently.
cant you just upload to S3 from your own dedicated machines? or it adds too much delay to operations? Author posted that images are first loaded on their system, resized and so on and then loaded on s3, so at least for image upload it shouldnt be such a great problem.
disclaimer: i have no smartphone and never used their app :)
Besides latency, you don't pay for internal data transfer within AWS services. If you did the image processing on your own machines, you'd be paying for bandwidth every operation; where if you do it in EC2, your only outbound transfer is viewing the images.
Instagram isn't paying on-demand prices, 3yr reserved is 48% cheaper than on-demand.