Queue hopping - MediaConvert

Queue hopping

A job stays in a SUBMITTED state, waiting to be processed, until the queue that you submit it to has available resources. To prevent long wait times, you can configure your job to automatically move to another queue after a set amount of time. This is called queue hopping.

Keep the following definitions in mind with queue hopping.

Submission queue

The queue that you originally submit a job to is its submission queue.

Destination queue

The queue that your job moves to when it hops queues is its destination queue.

Wait time

The amount of time your job waits in its submission queue until it can hop to its destination queue.

Hop

A job hops when it moves from its submission queue to its destination queue after its wait time elapses. A job that moves queues is also referred to as a hopped job.

A common use case for queue hopping is to move jobs from a reserved queue to an on-demand queue during a spike in usage. For example, you might automatically move jobs that sit in a SUBMITTED state for longer than 10 minutes.

Note

When you set up queue hopping from a reserved queue to an on-demand queue, MediaConvert bills you according to the queue type that your job ultimately runs in. If your job runs in a reserved queue, MediaConvert doesn't bill you separately for the job because the cost is already covered by what you pay for your reserved queue. If your job runs in an on-demand queue, MediaConvert bills you for the job at the on-demand rate.

Set up queue hopping

When you set up queue hopping, you specify the submission queue, the wait time, and the destination queue. Typically, the submission queue is a reserved queue and the destination queue is an on-demand queue. The following tabs show different options for setting up queue hopping.

Console

To set up queue hopping in the MediaConvert console:

  1. On the Create job page, choose Job management.

  2. Enable Queue hopping.

  3. Enter the amount of time until your job can hop with Wait minutes.

  4. For Destination queue, choose the queue that you want your job to hop to if it stays in the submission queue beyond its wait time.

  5. Optionally, specify a new Job priority if your job hops to its destination queue. For more information, see Set job priority for hopped jobs.

API, SDK, or the AWS CLI

To set up queue hopping in the API, SDK, or the AWS CLI, configure the settings for queue hopping under HopDestinations. This property is a direct child of Jobs, which is in the top level of the JSON job specification.

The following is an excerpt of a job settings JSON that hops to an on-demand queue after 10 minutes.

{ "Settings": { "OutputGroups": [...], "Inputs": [...] }, "HopDestinations": [ { "WaitMinutes": 10, "Queue": "arn:aws:mediaconvert:us-west-2:111122223333:queues/ondemandqueue", "Priority": 0 } ] }

For more information, see the MediaConvert API Reference.

View job history

When a job hops queues, the values for the settings queue and priority remain how you set them when you created the job. You can see the values for the job's post-hop destination and queue priority. The following tabs provide two options for viewing a job's history and queue priority.

Console

To see if your job hopped queues by using the MediaConvert console:

  1. Open the Jobs page in the MediaConvert console.

  2. Select a Job ID.

  3. Find the Queue transition section that shows the job priority before and after hopping. That section also shows the epoch Timestamp for when the job hopped, the Source queue, and the Destination queue.

AWS CLI

The following get-job example returns a JSON response with information about your job.

aws mediaconvert get-job \ --id 1234567890123-efg456

The following is an excerpt showing QueueTransitions in the JSON response when you run this command. The response shows your job's submission queue and destination queue.

"QueueTransitions": [ { "Timestamp": 1672662636, "SourceQueue": arn:aws:mediaconvert:us-west-2:111122223333:queues/submissionqueue, "DestinationQueue": arn:aws:mediaconvert:us-west-2:111122223333:queues/destinationqueue } ]

For more information about how to use the get-job command, see the AWS CLI Command Reference.

Billing tags for hopped jobs

If you use billing tags on your jobs and set your billing tags source to Queue, the charges for your jobs are always listed under the tags for the submission queue. To track how much you were billed for a job that hops queues, you can set the billing tags source to Job. For more information about using tags to sort your AWS bill, see Setting up AWS Elemental MediaConvert resources for cost allocation through tagging.

Note

Cost allocation based on queue only applies to jobs that run in on-demand queues. When your submission queue is a reserved queue and your job hops to an on-demand queue, the charges for that on-demand job appear in your cost allocation report. If you don't put tags on your reserved queue, those charges appear in the report unsorted.

Listing hopped jobs

When you view your job, MediaConvert displays the queue that you submitted your job. For example, if you submit a job to Queue1, and it hops to Queue2, that job appears in lists that are filtered for Queue1. It doesn't appear in lists filtered for Queue2.

Set job priority for hopped jobs

When you set up a job for queue hopping, you can specify the priority for the job in the new queue. If you don't specify a new priority, the job keeps the priority number from its submission queue.

If you use different guidelines for choosing the values for priority between the two queues, make sure to specify a new priority value for the job in the destination queue.

For information about setting the job's priority within the submission queue, see Job priority.

The following tabs provide different options for setting the priority of a hopped job.

Console

To set the priority of a hopped job in the MediaConvert console:

  1. Open the Create job page in the MediaConvert console.

  2. Choose Job management from the Job settings menu.

  3. Enable Queue hopping.

  4. Enter the Job priority for when your job hops to its destination queue.

  5. Enter both Wait minutes and Destination queue. For more information, see Queue hopping.

API, SDK, or the AWS CLI

You can set up a hopped jobs new priority by using the API, SDK, or the AWS CLI. To set it up, configure Priority under HopDestinations. This property is a direct child of Jobs, which is in the top level of the JSON job specification.

The following is an excerpt of a job settings JSON that sets a hopped job's priority to 25.

{ "Settings": { "OutputGroups": [...], "Inputs": [...] }, "HopDestinations": [ { "WaitMinutes": 10, "Queue": "arn:aws:mediaconvert:us-west-2:111122223333:queues/ondemandqueue", "Priority": 25 } ] }

For more information, see the MediaConvert API Reference.

Specify accelerated transcoding for hopped jobs

To reduce the transcoding time for certain jobs, use accelerated transcoding. In most cases, you submit accelerated jobs to on-demand queues, because reserved queues cannot run accelerated jobs. However, you can submit a job with Accelerated transcoding set Preferred to a reserved queue. When you do, if the job hops to an on-demand queue, it will run with acceleration enabled. For more information about accelerated transcoding, see Accelerated transcoding in the MediaConvert User Guide.

The following tabs provide different options for setting accelerated transcoding.

Console

To set Acceleration to Preferred in MediaConvert console:

  1. Open the Create job page in the MediaConvert console.

  2. Choose Job management from the Job settings menu.

  3. Under Acceleration, choose Preferred by using the dropdown list.

API, SDK, or the AWS CLI

To specify preferred acceleration by using the API, SDK, or the AWS CLI, configure Mode under AccelerationSettings. This property is a direct child of Jobs, which is in the top level of the JSON job specification.

The following is an excerpt of a job settings JSON that specifies queue hopping to an on-demand queue with accelerated transcoding.

{ "Settings": { "OutputGroups": [...], "Inputs": [...] }, "AccelerationSettings": { "Mode": "PREFERRED" }, "HopDestinations": [ { "WaitMinutes": 10, "Queue": "arn:aws:mediaconvert:us-west-2:111122223333:queues/ondemandqueue", "Priority": 25 } ] }

For more information, see the MediaConvert API Reference.

Queue hopping behavior with paused queues

Jobs don't hop from a queue while it's paused, but they hop freely to paused queues.

Hopping from a paused queue

Jobs don't hop from a queue while it's paused. Queue hopping behavior depends on how long the queue is paused. Consider these two situations:

You submit a job to a queue, pause the queue for longer than the queue hopping wait time, then reactivate it.

In this situation, whether the job hops depends on where the job is in the queue. If there are any jobs ahead of it in the queue, the job hops to the destination queue. If there are no jobs ahead of it in the queue, MediaConvert processes it without hopping.

For example, imagine that you submit a job to Queue1 with a wait time of 15 minutes and a destination of Queue2. Five minutes after you submit the job, you pause Queue1. Ten minutes later, the job remains in Queue1. Half an hour after that, you activate Queue1. At that time, there are no jobs ahead of it in Queue1, so the job runs from Queue1.

You submit a job to a queue. You pause the queue and then reactivate it before the wait time passes.

In this situation, the time that the queue is paused doesn't affect queue hopping at all.

For example, imagine that you submit a job to Queue1 with a wait time of 15 minutes and a destination of Queue2. Five minutes after you submit the job, you pause Queue1. One minute later, you reactivate Queue1. Nine minutes later (15 minutes after you submitted the job), there are still jobs ahead of it in the queue. Therefore, the job hops to Queue2, as though you hadn't paused the queue.

Hopping to a paused queue

Jobs hop freely from active queues to paused queues. For example, imagine that you submit a job to Queue1 with a wait time of 15 minutes and a destination of Queue2. Then, five minutes after you submit the job, you pause Queue2. Ten minutes later (15 minutes after you submit the job), the job hops to Queue2 and remains there, waiting until you activate the queue.