Throughput autoscaling: Dynamic sizing for Facebook.com

Facebook’s web tier is one of the main services that handle HTTP requests from people using our services each time they interact with Facebook. It is a massive global service distributed across mul…

Daniel Boeve
21 min readintermediate
--
View Original

Overview

The article discusses Facebook's implementation of throughput autoscaling for its web tier, a system designed to dynamically adjust resource allocation based on real-time demand. It highlights the importance of accurately predicting capacity needs to optimize resource utilization while maintaining service reliability.

What You'll Learn

1

How to implement throughput autoscaling for web services

2

Why predicting disaster demand is critical for service reliability

3

How to estimate supply through load testing

Prerequisites & Requirements

  • Understanding of autoscaling concepts and metrics
  • Familiarity with machine learning models and load testing(optional)

Key Questions Answered

How does throughput autoscaling improve resource utilization?
Throughput autoscaling dynamically adjusts the number of machines based on real-time demand, allowing Facebook to efficiently allocate resources during peak and off-peak times. This approach reduces the number of underutilized machines and enables the repurposing of resources for other workloads, such as machine learning tasks.
What is the role of disaster demand in capacity planning?
Disaster demand is the additional throughput required when a major data center becomes unavailable. Throughput autoscaling simulates this scenario to ensure that remaining data centers can handle the redistributed traffic, thus maintaining service reliability during outages.
How does Facebook estimate throughput supply?
Facebook estimates throughput supply by conducting load tests that measure the maximum throughput of individual machines under real traffic conditions. This data helps determine how many machines are needed to meet predicted disaster demand without degrading performance.
What safety mechanisms are in place for autoscaling?
Facebook employs several safety mechanisms, including a reactive autoscaling algorithm that responds to current demand, a watchdog service that monitors autoscaling health, and small-step downsizing to prevent drastic changes that could harm service performance.

Key Statistics & Figures

Peak load timing
Evening in Europe and Asia
This timing reflects the highest demand for Facebook's web tier.
Disaster recovery buffer
20 units of throughput
This is the buffer required to handle demand redistribution during a disaster scenario.

Technologies & Tools

Backend
Machine Learning
Used to predict steady-state demand and discern patterns in historical data.
Backend
Load Testing Platform
Utilized to measure the throughput supply of individual machines under real traffic conditions.

Key Actionable Insights

1
Implementing throughput autoscaling can significantly enhance resource efficiency by allowing services to dynamically adjust based on real-time demand.
This is particularly beneficial for services with variable usage patterns, enabling better resource allocation and reducing costs associated with underutilized infrastructure.
2
Regular load testing is essential for accurately estimating throughput supply and ensuring that services can handle peak demands.
By continuously monitoring and testing, organizations can adapt to changing traffic patterns and maintain optimal performance during unexpected surges.
3
Integrating predictive and reactive autoscaling algorithms can provide a robust safety net against demand fluctuations.
This dual approach helps ensure that services remain responsive and reliable, even in the face of sudden increases in traffic.

Common Pitfalls

1
Relying solely on historical data for demand predictions can lead to inaccuracies during unexpected traffic surges.
This occurs because historical patterns may not account for sudden changes in user behavior, making it crucial to incorporate real-time data and adaptive algorithms.
2
Neglecting to validate the capacity model can result in over or under-provisioning resources.
Without regular validation, the model's accuracy may degrade, leading to service disruptions during peak loads or inefficient resource use during off-peak times.

Related Concepts

Autoscaling Methodologies
Load Balancing Techniques
Capacity Planning Strategies