CDN Capacity Planning: Sizing for Traffic Spikes
CDN capacity planning is the process of analyzing traffic patterns, calculating bandwidth requirements, and provisioning infrastructure to handle both steady-state load and traffic spikes without performance degradation. Effective capacity planning ensures your CDN layer absorbs predictable surges like Black Friday sales or product launches, while your origin infrastructure handles the remaining cache misses without becoming a bottleneck. Getting this right prevents both over-spending on unused capacity and under-provisioning that causes outages during critical traffic events.
How Do You Establish a Baseline for CDN Traffic?
Capacity planning starts with understanding your current traffic profile. Without accurate baseline data, every subsequent calculation produces unreliable results.
Key Metrics to Collect
Gather at least 90 days of traffic data covering these metrics from your CDN monitoring tools:
- Requests per second (RPS) — Average and peak, broken down by content type (HTML, CSS/JS, images, API responses, video)
- Bandwidth (Gbps) — Total egress from CDN edge servers, tracked hourly to identify daily and weekly patterns
- Cache hit ratio — Overall and per content type. Static assets should hit 95%+, while dynamic content may be 30-60%
- Origin requests per second — Cache misses that reach your origin, the true measure of origin load
- Geographic distribution — Traffic volume by region, which determines which CDN PoPs carry the most load
- Average object size — Different for each content type, affects bandwidth calculations
Identifying Traffic Patterns
Most websites follow predictable traffic patterns that inform capacity planning:
| Pattern Type | Description | Burst Factor | Example |
|---|---|---|---|
| Diurnal | Daily peak during business or evening hours | 2-4x daily average | B2B SaaS, news sites |
| Weekly | Weekday vs weekend variance | 1.5-2x between low and high days | E-commerce, productivity tools |
| Seasonal | Annual peaks during holidays or events | 3-12x normal baseline | Retail (Black Friday), tax software |
| Event-driven | Unpredictable spikes from viral content or news | 10-100x baseline | Media sites, social platforms |
| Campaign-driven | Planned spikes from marketing or product launches | 5-20x baseline | Product launches, Super Bowl ads |
Your capacity plan must account for the highest burst factor your site realistically faces. Designing for the diurnal pattern while ignoring seasonal spikes leads to outages during your most critical revenue periods.
How Do You Calculate CDN Bandwidth Requirements?
The fundamental capacity formula connects user load to infrastructure requirements:
| Metric | Edge Processing | Origin Processing | Improvement |
|---|---|---|---|
| Latency (p50) | 8–15 ms | 120–300 ms | 15–20x faster |
| Cache Hit Ratio | 85–95% | N/A | Reduces origin load |
| TLS Handshake | 1–5 ms (nearby PoP) | 50–150 ms | 10–30x faster |
| Bandwidth Cost | $0.01–0.04/GB | $0.05–0.12/GB | 3–5x cheaper |
| Availability | 99.99% (multi-PoP) | 99.9% (single DC) | 10x fewer outages |
Peak CDN Bandwidth = Peak Concurrent Users × Avg Content per Session × Session Refresh Rate × (1 + Headroom Margin)
Worked Example: E-Commerce Site
An e-commerce site with the following profile:
- Normal peak: 20,000 concurrent users
- Black Friday peak: 200,000 concurrent users (10x burst)
- Average page: 2.5 MB (images, CSS, JS, HTML)
- Average session: 8 pages over 10 minutes
- CDN cache hit ratio: 94%
Normal peak bandwidth: 20,000 × (2.5 MB × 8) / 600s = 667 Mbps through CDN
Black Friday bandwidth: 200,000 × (2.5 MB × 8) / 600s = 6.67 Gbps through CDN
Origin load at Black Friday: 6.67 Gbps × (1 - 0.94) = 400 Mbps to origin
With 50% headroom: CDN must handle 10 Gbps, origin must handle 600 Mbps
This calculation reveals that the CDN layer easily absorbs the traffic (most providers handle 10 Gbps without special arrangements), but the origin must scale from its normal 40 Mbps to 600 Mbps—a 15x increase that requires careful preparation.
How Do You Pre-Warm CDN Caches Before Traffic Events?
Cache pre-warming ensures that edge PoPs have your content cached before traffic arrives, preventing a thundering herd of cache misses that overwhelm the origin during the initial surge. Effective cache warming follows a structured approach.
Pre-Warming Strategy
- Identify critical content — List all URLs that users will access during the event: landing pages, product pages, category pages, images, and static assets
- Prioritize by traffic volume — The top 100 URLs typically account for 60-80% of traffic during events. Warm these first
- Warm from multiple regions — Use distributed crawling tools (or your CDN provider warm-up API) to fetch content from PoPs in every region where you expect traffic
- Time the warming — Start 24-48 hours before the event. Allow enough time for the full content library to propagate across all edge PoPs
- Verify warm caches — Spot-check cache status headers from multiple geographic locations to confirm content is cached, not fetched from origin
TTL Coordination
Cache TTLs must extend beyond the event duration. If your normal TTL is 1 hour and the event lasts 6 hours, you will experience 6 rounds of cache expiration and re-fetching during the event. Temporarily increasing TTLs to 24 hours before the event ensures caches stay warm throughout. Coordinate this with your deployment schedule: avoid deploying code or content changes during the event that would trigger cache invalidation.
How Should You Scale Origin Infrastructure for CDN Traffic?
The origin is the constraint that breaks during traffic spikes, not the CDN. CDN providers engineer their edge networks for massive scale, but your origin server must handle every cache miss, and the cache miss volume grows proportionally with total traffic.
Origin Scaling Strategies
- Horizontal auto-scaling — Configure your origin behind a load balancer with auto-scaling groups that add instances when CPU, memory, or request queue depth exceeds thresholds. Pre-scale before events rather than relying on reactive scaling, which introduces 3-5 minutes of degraded performance during instance provisioning
- Origin shield — Enable an origin shield (a single CDN cache tier in front of your origin) to consolidate cache misses from all edge PoPs into one request. This can reduce origin request volume by 80-95%
- Read replicas — For database-backed dynamic content, add read replicas before events and configure your application to distribute read queries across them
- Static fallback — Pre-render critical pages as static HTML and configure the CDN to serve these if the origin becomes unresponsive, maintaining the user experience even during origin overload
Origin Capacity Matrix
| CDN Cache Hit Ratio | 10x Traffic Spike | Origin Load Multiplier | Action Required |
|---|---|---|---|
| 90% | 1,000 RPS → 10,000 RPS | 100 → 1,000 RPS | 10x origin scale |
| 95% | 1,000 RPS → 10,000 RPS | 50 → 500 RPS | 10x origin scale |
| 98% | 1,000 RPS → 10,000 RPS | 20 → 200 RPS | 10x origin scale |
| 99% | 1,000 RPS → 10,000 RPS | 10 → 100 RPS | 10x origin scale |
The table reveals a critical insight: regardless of cache hit ratio, a 10x traffic spike produces a 10x increase in origin requests. The cache hit ratio determines the absolute number, not the multiplier. A site with 98% cache hit ratio handling 10,000 normal RPS sends 200 RPS to the origin; at 10x spike, that becomes 2,000 origin RPS—still manageable for a well-provisioned origin.
How Do You Model CDN Costs for Variable Traffic?
CDN pricing models directly affect how traffic variability impacts your budget. Understanding the pricing structure helps you negotiate contracts that align with your traffic pattern.
Common CDN Pricing Models
- Pay-as-you-go — Charged per GB transferred, typically $0.02-$0.12/GB depending on volume and region. Simple and predictable, but expensive at scale
- Committed bandwidth — Monthly commitment for a sustained Gbps level at a discounted rate, with overage charges for bursts. Requires accurate baseline forecasting
- 95th percentile (burstable) — Charged based on the 95th percentile of 5-minute bandwidth samples over the billing period. Allows 5% of time at higher bursts without additional cost
- Request-based — Charged per HTTP request rather than per GB, beneficial for sites with many small objects
Cost Modeling for Events
For event-driven traffic, the 95th percentile model is usually most favorable because the spike occupies a small percentage of the billing period. A 4-hour Black Friday surge in a 720-hour month affects less than 1% of 5-minute samples, so it falls within the discardable top 5%. With pay-as-you-go pricing, that same surge incurs full per-GB charges on every additional byte transferred.
Review our CDN cost optimization guide for detailed strategies on minimizing costs across different pricing models. Work with your CDN provider performance benchmarking data to negotiate rates that reflect your actual traffic profile rather than accepting standard tier pricing.
What Is a CDN Capacity Planning Checklist?
Use this checklist before any planned traffic event or annual capacity review:
- Baseline audit — Confirm 90+ days of traffic data is collected and analyzed for patterns
- Burst factor calculation — Determine the maximum anticipated traffic multiplier for planned and unplanned events
- CDN provider notification — Inform your CDN provider 2-4 weeks before major events, providing expected peak bandwidth and duration
- Cache warming plan — Schedule pre-warming crawls 24-48 hours before events with URL priority lists
- TTL adjustment — Extend cache TTLs to cover the full event duration, avoiding mid-event expiration
- Origin auto-scaling — Pre-scale origin instances to handle pessimistic cache-miss scenarios. Validate scaling by load testing
- Origin shield verification — Confirm origin shield is enabled and health checks are properly configured
- Static fallback deployment — Pre-render critical pages and configure CDN failover to static versions
- Cost projection — Model CDN and origin costs at expected peak to avoid billing surprises
- Monitoring alerts — Set up real-time alerting for origin error rate, TTFB degradation, and cache hit ratio drops
- Runbook preparation — Document escalation procedures, CDN provider support contacts, and predefined mitigation actions
Effective capacity planning is the bridge between CDN architecture decisions and real-world performance under load. The best architecture fails without adequate capacity at every tier. Plan conservatively, test aggressively, and maintain clear communication channels with your CDN provider and internal engineering teams.