I was wondering how much it costs Google every year to be running Youtube, and I decided to do some quick cost analysis.
Luckily, Google does give some Youtube press statistics and we can calculate some metrics using a Youtube reference video. I also used the excellent youtube-dl tool for analyzing file sizes.
STORAGE
This is what Youtube says about how much content is being put up on Youtube:
“60 hours of video are uploaded every minute, or one hour of video is uploaded to YouTube every second.”
OK, that’s a good start. And our reference video is 4 minutes.
youtube-dl -F (for listing all formats) shows me:
37 : mp4 [1080x1920] 22 : mp4 [720x1280] 45 : webm [720x1280] 35 : flv [480x854] 44 : webm [480x854] 34 : flv [360x640] 18 : mp4 [360x640] 43 : webm [360x640] 5 : flv [240x400]
youtube-dl –all-formats (for downloading all formats) shows me that the total size of all formats/files is 340 MB of storage – for a 4 minute video.
I’m going to be a little optimistic and say that not all videos have a HD format and come in far fewer size options (in fact, probably a minority have HD video), so let’s say its about half that: 160 MB for a four-minute video (to make my calculation a bit easier to follow.)
Total storage for 1 minute = 160 MB / 4 minutes = 40 MB/min
Total storage for 1 hour = 40 MB/min x 60 mins = 2400 MB = 2.4 GB
As per Youtube stats, 1 hour of video is being uploaded every second, so 2.4 GB of video is uploaded every second.
* 86400 seconds/day = 207.36 TB / day
* 365 days/year = 75.686 PB / year
So there you go. Approximately 76 PB of video data is stored in Youtube every year.
At the time of writing, 2 TB hard drives cost approximately $100 or less.
So 76 PB x $50 / TB = $3,784,320 on storage costs
= $3.8 million in storage costs
So there we go. Approximately $4 million in storage costs per year, using commodity hard drives. (I suspect the actual number could range widely, given the variable lengths of videos, formats, etc.)
Next, on to networking costs.
NETWORKING
Again, from Youtube stats:
“Over 4 billion videos are viewed a day”
“Over 3 billion hours of video are watched each month on YouTube”
This is a bit more interesting – not all stored videos are served up, in fact, only one format of the video is selected and shown to the user.
Let me choose the [360×640] MPEG4 of the reference video, which is 40 MB in size. Also, let’s assume the user only watches 75% of the video or only that much is streamed over the network.
40 MB x 0.75 = 30 MB for 4 mins of video
30 MB / 4 mins * 60 min = 450 MB / hour
OK, over 3 billion hours of video are watched each month of Youtube. That is:
100 million hours a day = 450MB / hour * 100M = 45 PB/day
Per month = 45 PB * 30 = 1350 PB = 1.35 EB
Per year = 1.35 EB * 12 = 16.2 EB (exabytes!)
Wow. So 16.2 exabytes per year are sent through Youtube alone according to my calculations.
Now, I suspect I’m widely off mark here. For example, in Wikipedia’s entry on Exabytes, it says:
“Internet video will generate over 18 exabytes per month in 2013.”
And from this PC Magazine report, it looks like Youtube only accounts for 10% of Internet traffic. Note that that’s all of Internet traffic, so video is probably a great majority of that (if “HTTP”, according to the report, is 20%, then video is at 80%).
Still, I appear to be off by a factor, let’s say of 4x, so let’s say Youtube is only pushing 5 EB a year.
Amazon’s Cloudfront CDN charges $0.12 per GB for low-end customers. I suspect that Google/Youtube, through their combination of in-POP networks, working with ISPs, etc, is able to keep that cost down. Let’s say $0.01 per GB.
So $0.015 per GB = $15 per TB = $15,000 per PB = $15M per EB
Cost = 6 EB * $15M / PB = $90,000,000
= $90 million
So there we go. Approximately $90 million a year in networking costs. (Again, this number could vary wildly given the video sizes, network bandwidth required and most importantly aggressive CDN networking/technology solutions that I’m sure Google is deploying, as well as low CDN costs and any existing deals Youtube has with ISPs to reduce traffic for themselves and ISPs.)
So there we go, combining the two costs:
$4 million (storage) + $90 million (networking) = ~$100 million per year in networking+storage costs
This does not include the server count/costs for that, or personnel.
And I have to clarify again, that this is a very rough estimate, and I wouldn’t be surprised my numbers were off by a margin of 0.5x to 4x what I’ve come up with.
I think your analysis is probably off by a factor of 10. See: http://allthingsd.com/20120621/youtubes-gigantic-year-is-already-here-citi-says/. Of that $1.2B in expenses most is for bandwidth and infrastructure. Infrastructure includes hosting, peering, and storage expenses. We estimate that Google is now sending closer to 40 exabytes per year because of long form content and higher resolution. We have yet to find any third party to really validate anyone’s model, including Dan Rayburn.
That’s pretty awesome information, thanks for sharing!
Actually, I just read that article in more detail. Looks like that does include “infrastructure” costs – servers and stuff. I am NOT including server costs in my calculations here.
76 PB x $50 / TB = $3,784,320 on storage costs
76,000 TB x 50 Bucks / TB ~ 4 million bucks. But how much space do you need
for 76,000 Hard Drives? Let’s say they are using 2TB drives that means each year
Jutube must provide about 38,000 hard drives for their servers. How many hard
drives per server? My Jutube videos are stored on how many different servers? Or, are
they stored on the same server hard drive? We need better Video server sites then
Jutube. I tried some of the others but the front end is even worse then Jutube.
One thing to keep in mind–no way YouTube is using commodity, built-for-the-home-user drives. The Enterprise level storage they’re using would probably be at least 10x the cost per Tb you mentioned, even in the huge quantities they’re buying.
How much would it cost to buy servers to support 3% of Youtube content uploaders?
I think they are using CDN therefore it doesn’t costs them too much for the storage.
Your calculation is flawed from the beginning when you assume that they are storing the same 4 minute clip in 9 different formats, rather than converting on the fly.
its very cool information. may be youtube does compression also as that much data to store requres space and compression also to save storage space. what do u think guys
Few missing things: 1) Storage cost should include all videos ever uploaded; not just new uploads in that year. Just 4M on storage doesn’t pass the smell test. 2) Why add CDN cost to network costs? CDN is caching; don’t believe adding that to network costs make much sense 3) no video is stored with one copy; add at least 3x for storage costs to account for replication
Google have often stated they do use commodity/consumer HDD’s – not Enterprise. They found them very reliable. There’s various videos of their datacentres online where they talk about how they use liquid cooling now (cheaper than fans) and they’re on their 8th or so generation.
But the above calculations does not account for the fact that youtube at least duplicates the data across all HDD’s for redundancy – probably triple or quadruple for popular content – and with copies in various datacentres for reduced national bandwidth. You wouldn’t want valuable user videos dissapearing due to a corrupted HDD. You’ve also not accounted for the hardware that does the video encoding. That is 10,000+ stonkingly fast CPU’s doing that. Video encoding to mp4 is massively hardware intensive.