What Powers Instagram: Hundreds of Instances, Dozens of Technologies
instagram-engineering.tumblr.com
instagram-engineering.tumblr.com
Not to be too harsh - it's just three engineers, so it makes sense if the setup is still evolving.
They could do better but they'd have to manage their own datacenter and write portions of the app in C++. It's probably not worth it at this point unless they hire someone with that specific expertise.
What settings do you use for: MAGICK_MEMORY_LIMIT MAGICK_MAP_LIMIT MAGICK_DISK_LIMIT
Do you tune them dynamically or just set and forget?
Where do you learn this stuff? Do you need a CS Degree from stanford or something? I like the black magic aura, it's romantic, but I'd really like to understand how to scale websites doing stuff like the OP describes.
Server bill: $35k/month, $420k/year, per estimates in other comments.
Personnel, overhead, other expenses: $1.5M/year (guess).
Runway: 3.9 years to figure it out.
They could run their operation for 10-20% of their AWS costs at a dedicated server host. And everything would be much, much faster.
> 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.
disclaimer: i have no smartphone and never used their app :)
I would agree that EC2 isn't a no-brainer decision here, but it seems like a reasonable one.
I can guess at some of the reasons, such as they didn't foresee a user loading more than a few images at once. Perhaps they perceive rate limiting as a protective measure.
However, I've done testing on Twitpic, imgur, and yfrog and haven't run into the same issues. Twitpic, for example, generates a lot more traffic than Instagram and they don't have the same rate-limiting.
S3 accesses cost money, so it makes sense that they'd rate limit access to them. A botnet hitting an S3 URL could incur large fees for the owner of the file very rapidly.
That's crazy, if you ask me.
3rd reserved is roughly 48% cheaper than on-demand, so real hosting cost would be around $18,200 for those servers.