Skip to content

CDN warmup streams on Edge

Overview

Usually, a CDN stream starts longer for the first subscriber on Edge because it needs time to establish a media connections between nodes. Since build 5.3.295, a CDN streams may be warmed up, or pre-pulled from Origin to Edge (via Transcoder if needed).

CDN warmup configuration

Streams warming up should be enabled by the following parameter on Edge server

cdn_warmup_enabled=true

By default, no streams are pulled. A special configuration file /usr/local/FlashphonerWebCallServer/conf/cdn_warmup_trap.json is needed to pull anything. This prevents a possible inner CDN channels and server overload.

A simplest configuration to allow all the CDN streams pulling to the Edge (this is not recommended for production use)

{
    "streams":
    [
        {
            "streamName": ".*",
            "profiles" : [ "SOURCE" ]
        }
    ] 
}

And more complex filter example:

  • streams named abrStream are pulled in two profiles and in original quality;
  • streams named sourceStream are pulled in in original quality only
  • all the rest streams are pulled in 360p quality
{
    "streams" : 
    [ 
        {
            "streamName" : "abrStream.*",
            "serverIps" : [ "192.168.88.0/24" ],
            "abr": true,
            "profiles" : [ "SOURCE", "-720p", "-360p" ]
        },
        {
            "streamName" : "sourceStream.*",
            "serverIps" : [ "192.168.88.0/24" ],
            "profiles" : [ "SOURCE" ]
        },
        {
            "streamName" : ".*",
            "serverIps" : [ "192.168.88.0/24" ]
        }
    ],
    "defaultProfile" : "-360p"
}

Where:

  • streamName - stream name mask to pull
  • serverNames - a list of Origin server domain names to pull a streams published on them
  • serverIps - a list of Origin server IP addresses or masks to pull a streams published on them
  • profile - a profile to transcode streams while pulling, should be described in cdn_profiles.yml file
  • SOURCE - a special keyword for original quality (no any video transcoding)
  • defaultProfile - a default transcoding profile to use if profile is not defined for the filter

The stream conforming to filter will be pulled from Origin, and will never be stopped until its publishing stop.

CDN warmup REST API

CDN streams may be warmed up via REST API /rest-api/v3/cdn/warmup