Almost every gamer loves to watch how others play, resulting in Twitch being a super popular video streaming platform as it is!
According to TwitchTracker.com in August 2019 only, Twitch have shown 999 Million Hours of video content to viewers. Average concurrent viewers reached 1,342,559.
What are the monthly infrastructure costs does the Twitch has? Let’s find out!
We know that Twitch gets video from the broadcaster, transcodes it to HLS video format and sends it further to viewers. Technically this is done via a network of servers across the world called CDN (Content Delivery Network).
Twitch can have those servers physically or rent them from bigger cloud companies. We can estimate both options.
But first, we determine the amount of data Twitch send back and forth to all viewers. According to Twitch rules, 6000 kbps is the maximum bitrate allowed. But many streamers use lower bitrate, since not every internet connection is stable enough to send 6000 kbps steadily. I would choose 3000 kbps (3 Mbps) as an average for all users.
Now we calculate how many megabytes we send in 1 hour when streaming at 3 Mbps speed. For that, we divide 3 Mbps/8 and get 384 kilobytes per second. Next, multiply 384 kilobytes per second * 60 seconds * 60 minutes = 1350 Megabytes per hour.
Good, now we multiply all our 999 million hours x 1350 Megabytes per hour and receive huge data traffic number: 1,348,650,000,000 megabytes.
Or if we convert it: 1,317,041,016 Gigabytes or 1,286,173 Terabytes, or 1,256 Petabytes.
Quite a lot, heh? 🙂
Let’s convert that to dollars $ now. What if Twitch decides to use Amazon AWS cloud hosting?
There are different prices for data usage and Amazon charges different rates for different regions. But since Twitch sends Petabytes, I will use the last number of $0.02 per GB as an average. One more thing, Amazon says it has special discount rates for Customers who send more than 10 TB/month. Let’s take a guess and decrease the price to $0.010 per GB. By the way, 1 cent per GB is a usual thing for clouds like DigitaOcean, so we are quite close in our assumptions.
Now, if we multiply Twitch August data traffic of 1,317,041,016 Gigabytes by one cent we receive a huge $13,170,410 bill. Yes, this is 13 million USD per month, only for the data traffic.
But Twitch is not so stupid to pay such funds to the cloud. I bet they created their own network of servers around the world. My guess, they pay from 50% to 70% less, from the amount of money above.. That’s roughly from $4 mln to $6 mln per month for data traffic
Ok, so that was Data Traffic. And Twitch also needs servers to run the show. How much is that?
Some companies claim they can run HLS on one server supporting 50.000 viewers. That’s ok, but in our Twitch case the video bandwidth is as high as 3 Mbps and we will hit the ceiling with the network capacity per one server. Amazon provides 20 Gbps network per one server (not for all servers, just for special plans). So if we divide 20 Gbps per 3Mbps, we will get somewhere 7000 viewers per server.
Let’s calculate the numbers for Amazon. I think a1.large* server ($0.051 per Hour) should do the work. So we take our number of average viewers 1,342,559 and divide by 7000 viewers per server: and we get 192 average servers. Not that many. But this is the ideal situation, I would say we need to multiply that amount by 3x to have stable video delivery. So 3×192 = 576 servers. And monthly costs would be $771,120 per month for all those 576 servers running 24/7.
*a1.large has lower network capacity than 20 Gbps, but let’s assume a big company can ask Amazon to increase that server network bandwidth
Now get back closer to reality. I think Twitch uses its own servers, but I’m not sure they can save much here. They need to buy those machines, colocate them, pay for electricity, pay colocation rent, etc. Let’s leave that number as it is $771K per month for servers running.
Summary: by simple calculations we can assume that Twitch may spend around $4,000,000 – $6,000,000 every month for the Data traffic and $771,000 on top of that for servers.
We are Trembit.com ! Specializing in building complex video streaming systems. Let’s verify your ideas together at : email@example.com
P.S. I haven’t included a team of DevOps (Development Operations) engineers here, who monitor the servers all the time. I would assume Twitch needs at least 6 engineers to support the platform 24/7. Also please note that we talked only about video streaming part of Twitch. Definitely other parts are important like video storage, database, servers to handle user requests, etc.