Configuration guidelines for live streaming
The Fastly network can deliver live streams for any HTTP streaming technology, archived or recorded, on any public or private cloud storage service. When configuring VCL to deliver live streams, we recommend following these guidelines:
- Configure shielding. Configure shielding by designating a specific shield POP for your origin to ensure live streams remain highly available within the Fastly network. If your setup includes primary and alternate origins (e.g., for high profile live streams), be sure to select a shield POP, close to each origin, one for each origin you define.
- Set different caching TTLs. Set manifest file TTLs to less than half of the video segment duration, typically 1-2 seconds for 5-second video segments. For long DVRs and live-to-VOD transitions, set segment TTLs longer on shields and shorter on edge POPs such that they are served from memory (that is, less than 3600s).
- Configure Streaming Miss. Configure Streaming Miss to reduce the time clients (players) must wait to begin downloading streams when Fastly's edge servers must fetch content from your origin.
- Enable TCP optimizations. Enable TCP tuning optimizations (e.g., CWND size) between cache servers and clients. For example, consider setting the CWND value higher, between 20-25. Enabling TCP optimizations allows clients to better estimate network bandwidth and thereby select the ideal rendition and bitrate for the best playback quality.
- Take advantage of surrogate key purging. All video segments and the manifest for a live stream can be purged using a single API call by using Fastly’s surrogate key feature.
- Consider setting up failover (fallback) origins. Consider configuring your VCL to allow your origins to failover from high-profile primary streams to alternate streams in case of encoder failures or other issues (e.g., high resource utilization).
- Manage live-to-VOD smoothly. Most encoders generate a separate video manifest when making the same live stream available for VOD. If your VOD manifest has the same URL as the live one, purge the live stream video manifest or wait for the caches to invalidate (as they will be set with low TTLs). If your setup archives the live stream as progressive mp4s, consider delivering them using Fastly’s OTFP service.
Questions about live streaming setup and configuration? Contact our Customer Support team any time.