Origin RU Estimate
Using Azure Media Services Live, you can stream live video content to viewers.
When designing a live streaming solution using Azure Media Services, it is necessary to make estimate of the number of origin RUs (Reserved Units) you need.
For this purpose, first a few basic facts are in order:
- If you allocate n origin RUs, it implies you will have n + 1 VMs in your origin by Azure Media Service design;
- Each VM used in streaming origins is medium size (2-core) with maximum bandwidth of 200Mbps. Azure SLA dictates 80% of the maximum bandwidth. Hence we should always consider the egress bandwidth of each VM to be 200Mbps x 80% = 160Mbps.
- A CDN vendor like Akamai usually allocates x number of parent regions for a streaming solution. Each parent region can request x number of times for each fragment of each format, e.g. 2.5x. Edge servers avoid going over the designated multiples, but it may be possible depending on the size of the regions.
The total egress of a live channel streaming adaptive bitrate (ABR) content can be calculated by:
Total Egress = [Aggregate bitrate] x [# of CDN parent cache] x [# of ABR formats] x [Parent region multiple]
For example, suppose your scenario is as below:
- Aggregate bitrate of the ABR profile is 10Mbps across all bitrates;
- 9 parent regions are planned in your CDN configuration;
- 2 formats are streamed: smooth streaming and HLS;
- Parent region request multiplier is 2.5.
In this case, the total egress will be:
10Mbps (aggregate bitrates) x 9 (parent regions) x 2 (formats) x 2.5 = 450 Mbps.
If each RU bandwidth is 200Mbps with 80% SLA resulting to160Mbps, in this case we need 450/160 = 2.8, or 3 VMs, which means 2 origin RUs. Of course you may want to add extra as safety margin.
Request Rate Estimate
Next we calculate peak requests as below:
Peak Requests = [# of Regions] x [Region multiplier]x([# ABR formats] + [1 Audio])x[# of Formats]
The media only changes every x number of seconds (say 6 seconds), we need to ensure they do not timeout for that amount of time.
Thus, we need to ensure we can accept all the requests simultaneously, and provide correct responses for all the requests within 6s.
For the same scenario listed above, the request rate over 6 seconds will be
9 x 2.5 x (7 + 1) x 2/6 = 60 RPS
Estimating Live Streaming Cost
One common question is how to estimate the cost of a live streaming. Let's focus on the cost associated with Azure. There are the following cost items:
- Live archive storage cost: this depends on the duration of live archive, which is not necessarily the same as the duration of a live event since Azure Media Services Live allows you to specify a rolling window of live archive.
- CDN cost: this of course depends on which CDN vendor you use.
- Live channel cost: according to Media Services Pricing Details, the price is $0.49/hour for each channel (after 50% preview discount).
- Streaming cost: [# of streaming RU] x $139/month, where [# of streaming RU] can be estimated as in the first section of this blog.
Notice that the above list does not include live encoding cost, which again depends on the live encoding service/vendor you choose. The cost can be as low as negligible if you use a free/low-cost live encoder running on your laptop and publishing into Azure Media Services channel ingest endpoint. Or depending on your quality needs, the cost figure can be provided by the live encoder vendor you choose, such as iStreamPlanet Aventus.