Autoscale Media Services premium streaming endpoints
Article
Warning
Azure Media Services will be retired June 30th, 2024. For more information, see the AMS Retirement Guide.
Overview
You have a large, live streaming media event coming up but you’re not sure how
many streaming units you are going to need. Not planning for enough resources
can cause issues with playback quality at media delivery time.
Fortunately, you can autoscale the premium streaming endpoints in your Media
Services account based on any available metrics for the streaming endpoint, or
metrics for any related entities. A combination of these metrics can be used to
create the rule for autoscaling.
Note
Custom autoscaling is only available for premium streaming endpoints. However, you can also easily switch from standard to premium endpoints without any interruptions in service.
Autoscaling a Media Services streaming endpoint is easy to do using Azure
Autoscale.
Some examples of metrics you may use for autoscaling are:
The average CPU usage goes over 50% in the last 10 minutes.
The average egress bandwidth goes over 200Mbps per streaming unit in the last 10 minutes.
A high number of requests result in a particular error code, a 503 server unavailable status code, and output format in the last 30 minutes.
You can also autoscale based on the number of running live events.
Set up autoscaling for a streaming endpoint in the Azure portal
Set up a default condition
From the Azure home screen, select Monitor from the main menu, or select
More services à and select the Monitor icon.
Select Autoscale from the menu. The Autoscale screen will open.
Select the subscription you want to work with from the Subscription
dropdown list.
Select the resource group from the Resource group dropdown list.
Select Media Services from the Resource type dropdown list.
Select the premium streaming endpoint that you want to autoscale from the streaming endpoint list. The Autsocale setting screen will appear.
Select the Configure tab.
Select the Custom autoscale radio button.
The Autoscale setting name field will already be populated, but you can change it if you need to.
The Resource group dropdown list will have the resource group already
selected.
Give the Default autoscaling condition a name, or not.
Choose either the:
Scale to a specific instance count radio button.
Enter the number of streaming instances you want in the Instance
count field. If you make this choice, the streaming endpoints will
scale to the set amount automatically or when none of the other
conditions are present, if you created rules based on a metric.
Scale based on a metric radio button.
Select Add a rule from the warning message. The Scale rule
screen appears. The metric source should already be selected.
Select Average, Minimum, Maximum, Sum, Last or Count from the Time aggregation dropdown list.
The Metric namespace should already be selected.
Select CPU usage, Egress, Egress bandwidth, Requests, or Success end to end latency from the Metric name dropdown list.
You can get more information about each metric by choosing a dimension. Dimensions available for some metrics are Error Code, HTTP Status Code, and Output Format. Select one or more of these based on what information you need.
Select an operator from the Operator dropdown list. For example, if you want to autoscale when the CPU is greater than 70%, then choose Greater than.
In the Action section, choose the action from the Operation dropdown list, enter the number of minutes in the Cool down field, and enter the number of instances to increase by in the Instance count field. For example, enter Increase count by 1 and wait for 15 minutes before checking again to see if the CPU usage is greater than 70%.
Select Add.
Enter values for the Minimum, Maximum and Default number of instances there should be for the premium streaming endpoint.
Set up additional conditions
Demand for the streaming endpoint may go up or down during a range of time. If
you expect a surge in audience for upcoming live streaming events, you can set
up a time-based autoscale rule to allocate enough streaming units beforehand. Be
sure to allow 20 minutes for streaming units to be fully provisioned.
Follow the same steps as above but to schedule autoscaling, choose the Time
zone, the Start date and End date to apply the condition. You can also
schedule the condition during recurring time period by selecting Repeat
specific days radio button then selecting the days.
Note
Be aware that the default condition is the one that will be applied when no other conditions have been met.
Editing or deleting an autoscaling condition
To edit the condition, select the pencil icon.
To delete the condition either select the trash can icon in the header of
the condition area or select the pencil icon and select the Delete
button from the Scale rule screen.
Plan and execute an endpoint deployment strategy, using essential elements of modern management, co-management approaches, and Microsoft Intune integration.