How Disney+ Hotstar Scaled to 25 Million Concurrent Users

Listen to this Post

Disney+ Hotstar successfully scaled to handle 25 million concurrent users by implementing several key strategies:

  • Multi-level caching to scale reads efficiently.
  • Rate limiting to prevent server overload.
  • Baked container images for faster provisioning.
  • Diverse AWS instance types to maximize resource availability.
  • Panic mode to avoid server overload during peak traffic.
  • Jitter and caching to mitigate the thundering herd problem.
  • Pre-warming infrastructure ahead of major events to handle estimated peak traffic.

For more details, read the full article: Disney+ Hotstar Scaling Case Study

Practice-Verified Commands and Codes

1. Multi-level Caching with Redis:


<h1>Install Redis</h1>

sudo apt-get install redis-server

<h1>Start Redis service</h1>

sudo systemctl start redis

<h1>Test Redis connection</h1>

redis-cli ping

2. Rate Limiting with Nginx:

http {
limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s;

server {
location / {
limit_req zone=one burst=5;
proxy_pass http://backend;
}
}
}

3. Docker Container Baking:


<h1>Create a Dockerfile</h1>

FROM ubuntu:20.04
RUN apt-get update && apt-get install -y nginx
CMD ["nginx", "-g", "daemon off;"]

<h1>Build the Docker image</h1>

docker build -t my-nginx .

<h1>Run the container</h1>

docker run -d -p 80:80 my-nginx

4. AWS CLI for Instance Management:


<h1>List EC2 instances</h1>

aws ec2 describe-instances

<h1>Launch a new EC2 instance</h1>

aws ec2 run-instances --image-id ami-0abcdef1234567890 --instance-type t2.micro --key-name MyKeyPair

5. Jitter Implementation in Python:

import random
import time

def jitter_sleep(base_delay):
jitter = random.uniform(0, base_delay)
time.sleep(base_delay + jitter)

jitter_sleep(1) # Sleep for 1 second plus a random jitter

What Undercode Say

Scaling systems to handle millions of concurrent users requires a combination of strategic planning, robust infrastructure, and efficient resource management. Disney+ Hotstar’s approach highlights the importance of multi-level caching, rate limiting, and pre-warming infrastructure to ensure high availability and performance during peak traffic. By leveraging AWS instance types and baked container images, they achieved rapid provisioning and scalability. Implementing panic mode and jitter further ensured system stability under extreme load.

For system administrators and developers, mastering tools like Redis, Nginx, Docker, and AWS CLI is essential. These tools enable efficient caching, rate limiting, containerization, and cloud resource management. Additionally, understanding concepts like the thundering herd problem and proactive load management can significantly enhance system resilience.

To dive deeper into these topics, explore the following resources:
Redis Documentation
Nginx Rate Limiting
Docker Documentation
AWS CLI Command Reference
System Design Basics

By adopting these strategies and tools, you can build scalable, resilient systems capable of handling massive traffic loads, just like Disney+ Hotstar.

References:

initially reported by: https://www.linkedin.com/posts/nk-systemdesign-one_give-me-2-minutes-and-ill-teach-you-how-activity-7301950792217890816-_JZC – Hackers Feeds
Extra Hub:
Undercode AIFeatured Image