Bugpit

Lessons › Real apps

Hotstar: 25 million watching

On July 10, 2019, India played New Zealand in the World Cup semi-final and 25.3 million people watched on Hotstar at the same moment. You're running one fiftieth of that: 20,000 req/s. 80% are pieces of live video, and every request reaches your own servers. Recommendations sit in the path of every page, with nothing to stop them taking the app down.

Play this level

Part of Bugpit Pro. It runs in your browser: build the design, press Run, and watch what breaks.

The lesson

Live video is the easy part to move. Every viewer asks for the same few seconds of the same match, so a CDN answers almost all of it, and object storage holds the original. Hotstar's peak used more than 10 Tbps, by its own account most of India's internet capacity at that moment.

The hard part is the crowd's shape. When a famous batsman walks out, a million people can arrive in a minute. Hotstar said a new server took about 90 seconds to get ready, and normal autoscaling reacts after the load arrives. So they scaled before the match, based on how many people were watching, not on how busy the servers looked.

That's why the app servers here are sized for the peak before you press Run. There's no time to add them once the crowd is in.

And when it still goes wrong, decide in advance what can be switched off. Hotstar called it panic mode: turn off recommendations and personalisation, and keep video and subscriptions working. A circuit breaker does that automatically: if recommendations fail, the page loads without them.

What you have to achieve

20,000 requests a second at the busiest hour, 1% of them writes and 80% static files.

What you learn

Crash Recommendations: the match keeps playing. Two ideas carried this night. Plan capacity for the crowd you know is coming, because reacting is too slow. And know which features you can live without, before you need to.

The real numbers behind it

Check yourself

A new server takes 90 seconds to get ready, and a million viewers can arrive in a minute. What did Hotstar do?

Show the answer

Scaled up before the match, based on how many people were watching. Reacting is too slow for a crowd you know is coming. Plan for it in advance.

What did Hotstar's panic mode switch off to keep the match playing?

Show the answer

Recommendations and personalisation. Decide in advance what you can live without. A circuit breaker does it automatically.

Try it yourself

More in Real apps

← Fortnite: 3.4 million at once UPI: 25 billion payments a month →