Skip to content

Commit df081cc

Browse files
committed
updates
1 parent 7a348c4 commit df081cc

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

articles/media-services/latest/media-services-high-availability-encoding.md

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,40 @@ ms.author: juliako
1818

1919
# Media Services high availability encoding guidance
2020

21-
Azure Media Services encoding service is a regional batch processing platform and not currently designed for high availability within a single region. The encoding service currently does not provide instant failover of the service if there is a regional datacenter outage or failure of underlying component or dependent services (such as storage, SQL, etc.) This article explains how to deploy Media Services to maintain a high-availability architecture with failover and ensure optimal availability for your applications.
22-
21+
Azure Media Services encoding service is a regional batch processing platform and not currently designed for high availability within a single region. The encoding service currently does not provide instant failover of the service if there is a regional datacenter outage or failure of underlying component or dependent services (such as storage, SQL, etc.) This article explains how to deploy Media Services to maintain a high-availability architecture with failover and ensure optimal availability for your applications.
2322
By following the guidelines and best-practices described in the article, you will lower risk of encoding failures, delays, and minimize recovery time if an outage occurs in a single region.
2423

2524
## How to build a cross-regional encoding system
2625

2726
* [Create](create-account-cli-how-to.md) two (or more) Azure Media Services accounts.
2827

29-
The two accounts need to be in different regions.
30-
* Upload your media to the same region from which you are planning to submit the [job](transforms-jobs-concept.md). For more information about how to start encoding, see [Create a job input from an HTTPS URL](job-input-from-http-how-to.md) or [Create a job input from a local file](job-input-from-local-file-how-to.md).
28+
The two accounts need to be in different regions. For more info, see [regions in which the Azure Media Services service is deployed](https://azure.microsoft.com/global-infrastructure/services/?products=media-services).
29+
* Upload your media to the same region from which you are planning to submit the job. For more information about how to start encoding, see [Create a job input from an HTTPS URL](job-input-from-http-how-to.md) or [Create a job input from a local file](job-input-from-local-file-how-to.md).
3130

32-
If you then need to resubmit the job to another region, you can use JobInputHttp or have storage copy the data from one storage account to another.
33-
* Subscribe for **JobStateChange** messages in each account.
31+
If you then need to resubmit the [job](transforms-jobs-concept.md) to another region, you can use JobInputHttp or use [Copy-Blob](https://docs.microsoft.com/rest/api/storageservices/Copy-Blob) to copy the data from the source Asset container to an Asset container in the alternate region.
32+
* Subscribe for JobStateChange messages in each account via Azure Event Grid. For more information, see:
3433

35-
* In Media Services v3, it is done via Azure Event Grid. For more information, see:
36-
37-
* [Event Grid examples](../../event-grid/receive-events.md),
38-
* [Azure Event Grid schemas for Media Services events](media-services-event-schemas.md),
39-
* [Register for events via the Azure portal or the CLI](reacting-to-media-services-events.md) (you can also do it with the EventGrid Management SDK)
40-
* [Microsoft.Azure.EventGrid SDK](https://www.nuget.org/packages/Microsoft.Azure.EventGrid/) (which supports Media Services events natively).
41-
42-
You can also consume Event Grid events via Azure Functions.
43-
* In Media Services v2, this is done via [NotificationEndpoints](../previous/media-services-dotnet-check-job-progress-with-webhooks.md).
44-
* When you [create a job](transforms-jobs-concept.md):
34+
* [Audio Analytics sample](https://github.com/Azure-Samples/media-services-v3-dotnet/tree/master/AudioAnalytics/AudioAnalyzer) which shows how to monitor a job with Azure Event Grid including adding a fallback in case the Azure Event Grid messages are delayed for some reason.
35+
* [Azure Event Grid schemas for Media Services events](media-services-event-schemas.md)
36+
* [Register for events via the Azure portal or the CLI](reacting-to-media-services-events.md) (you can also do it with the EventGrid Management SDK)
37+
* [Microsoft.Azure.EventGrid SDK](https://www.nuget.org/packages/Microsoft.Azure.EventGrid/) (which supports Media Services events natively).
4538

39+
You can also consume Event Grid events via Azure Functions.
40+
* When you create a [job](transforms-jobs-concept.md):
41+
4642
* Randomly select an account from the list of currently used accounts (this list will normally contain both accounts but if issues are detected it may only contain one account). If the list is empty, raise an alert so an operator can investigate.
47-
* General guidance is you need one [media reserved unit](media-reserved-units-cli-how-to.md) per task or [JobOutput](https://docs.microsoft.com/rest/api/media/jobs/create#joboutputasset) (unless you are using [VideoAnalyzerPreset](analyzing-video-audio-files-concept.md) in v3).
48-
* Get the count of [media reserved units](media-reserved-units-cli-how-to.md) (MRUs) for the chosen account. If the current **media reserved units** count isn't already at the maximum value, add the number of the MRUs needed by the job and update the service. If your job submission rate is high and you are frequently querying the MRUs to find you are at the maximum, use a distributed cache for the value with a reasonable timeout.
43+
* General guidance is you need one [media reserved unit](media-reserved-units-cli-how-to.md) per [JobOutput](https://docs.microsoft.com/rest/api/media/jobs/create#joboutputasset) (unless you are using [VideoAnalyzerPreset](analyzing-video-audio-files-concept.md) where 3 media reserved units per JobOutput is recommended).
44+
* Get the count of media reserved units (MRUs) for the chosen account. If the current **media reserved units** count isn't already at the maximum value, add the number of the MRUs needed by the job and update the service. If your job submission rate is high and you are frequently querying the MRUs to find you are at the maximum, use a distributed cache for the value with a reasonable timeout.
4945
* Keep a count of the number of inflight jobs.
50-
* When your JobStateChange handler gets a notification that a job has reached the scheduled state, record the time it enters the schedule state and the region/account used.
46+
47+
* When your JobStateChange handler gets a notification that a job has reached the scheduled state, record the time it enters the schedule state and the region/account used.
5148
* When your JobStateChange handler gets a notification that a job has reached the processing state, mark the record for the job as processing.
5249
* When your JobStateChange handler gets a notification that a job has reached the Finished/Errored/Canceled state, mark the record for the job as final and decrement the inflight job count. Get the number of media reserved units for the chosen account and compare the current MRU number against your inflight job count. If your inflight count is less than the MRU count, then decrement it and update the service.
53-
* Have a separate process that periodically looks at your records of the jobs. If you have jobs in the scheduled state that haven't advanced to the processing state in a reasonable amount of time for a given region, remove that region from your list of currently used accounts.
54-
55-
* Depending on your business requirements, you could decide to cancel those jobs right away and resubmit them to the other account. Or, you could give them some more time to move to the next state.
56-
* After a period of time, add the account back to the currently used list (with the assumption that the region has recovered).
50+
* Have a separate process that periodically looks at your records of the jobs
51+
52+
* If you have jobs in the scheduled state that haven't advanced to the processing state in a reasonable amount of time for a given region, remove that region from your list of currently used accounts. Depending on your business requirements, you could decide to cancel those jobs right away and resubmit them to the other region. Or, you could give them some more time to move to the next state.
53+
* Depending on the number of Media Reserved Units configured on the account and the submission rate, there also may be jobs in the queued state the the system has not picked up for processing yet. If the list of jobs in the queued state grows beyond an acceptable limit in a region, those jobs can be cancelled and submitted to the other region. However, this may be a symptom of not having enough Media Reserved Units configured on the account for the current load. You can request a higher Media Reserved Unit quota through Azure Support if necessary.
54+
* If a region was removed from the account list, monitor it for recovery before adding it back to the list. The regional health can be monitored via the existing jobs on the region (if they weren't canceled and resubmitted), by adding the account back to the list after a period of time, and by operators monitoring Azure communications about outages that may be affecting Azure Media Services.
5755

5856
If you find the MRU count is thrashing up and down a lot, move the decrement logic to the periodic task. Have the pre-job submit logic compare inflight count to the current MRU count to see if it needs to update the MRUs.
5957

articles/media-services/latest/media-services-high-availability-streaming.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Azure Media Services high availability streaming
3-
description: Learn how to failover to a secondary Media Services account if a regional datacenter outage or failure occurs.
3+
description: Learn how to fail over to a secondary Media Services account if a regional datacenter outage or failure occurs.
44
services: media-services
55
documentationcenter: ''
66
author: juliako
@@ -18,7 +18,7 @@ ms.author: juliako
1818

1919
# Media Services high availability streaming guidance
2020

21-
Azure Media Services encoding service is a regional batch processing platform and not currently designed for high availability within a single region. The encoding service currently does not provide instant failover of the service if there is a regional datacenter outage or failure of underlying component or dependent services (such as storage, SQL, etc.) This article explains how to deploy Media Services to maintain a high-availability architecture with failover and ensure optimal availability for your applications.
21+
Azure Media Services encoding service is a regional batch processing platform and not currently designed for high availability within a single region. The encoding service currently does not provide instant failover of the service if there is a regional datacenter outage or failure of underlying component or dependent services (such as storage, SQL) This article explains how to deploy Media Services to maintain a high-availability architecture with failover and ensure optimal availability for your applications.
2222

2323
By following the guidelines and best-practices described in the article, you will lower risk of encoding failures, delays, and minimize recovery time if an outage occurs in a single region.
2424

@@ -30,7 +30,7 @@ Review [How to build a cross-regional encoding system](media-services-high-avail
3030

3131
* Video-on-demand cross region streaming involves duplicating [Assets](assets-concept.md), [Content Key Policies](content-key-policy-concept.md) (if used), [Streaming Policies](streaming-policy-concept.md), and [Streaming Locators](streaming-locators-concept.md).
3232
* You will have to create the policies in both regions and keep them up to date.
33-
* When you create the streaming locators, you will want to use the same Locator Id value, ContentKey Id value, and ContentKey value.
33+
* When you create the streaming locators, you will want to use the same Locator ID value, ContentKey ID value, and ContentKey value.
3434
* If you are encoding the content, it is advised to encode the content in region A and publish it, then copy the encoded content to region B and publish it using the same values as from region A.
3535
* You can use Traffic Manager on the host names for the origin and the key delivery service (in Media Services configuration this will look like a custom key server URL).
3636

0 commit comments

Comments
 (0)