[object Object] Icon

Encoding
Learn how to create, start, manage and modify Encodings

[object Object] Icon

Player
Learn how to create, start, manage and modify Players

[object Object] Icon

Analytics
Learn how to create, start, manage and modify Analyticss

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

Mon Nov 23 2020

[BETA] How to use Pre-warmed Encoder Pools

OverviewLink Icon

Pre-warmed encoder pools, are a collection of idle encoding resources which can be immediately aquired by starting encodings that are configured to take resources from such a pool. If an encoding takes a resource from a pool, this pool automatically provisions additional encoding resources to maintain its target size at any time.

Why would I use that? - It allows you to optimize the total turn around time of your workflow by basically removing the queue time for an encoding. When properly configured for your use-case, your encoding queue time drops down ~0 to a few seconds consistently. This way you can achieve a continuous throughput as a dedicated pool of encoding resources is exclusively available to your Bitmovin Account.

Key Features

  • Create a pool of pre-warmed encoding resources - Encodings which refill's automatically and maintains a minimum number of always available encoding resources.
  • Schedule the availability of pre-warmed encoder pools - If you only want to have them pre-warmed, e.g. during your business hours or other specific time frames where you know you would need them, you can schedule the start and stop of a pool ahead of time
  • Works with Cloud Connect for AWS, GCP, and Azure - Create pre-warmed encoder pools in your own connected infrastructure.

RequirementsLink Icon

  • Open API SDK v1.53+
  • BETA features are not enabled by default, they have to be enabled by our team.

Known LimitationsLink Icon

Due to the feature being in BETA it comes with the following limitations:

  • only one pre-warmed encoder pool can be assigned to the start-request for an encoding
  • At the moment, pre-warmed encoder pools can be used for VoD encoding workflows only
  • Pool status - At the moment, it only reflects if a pool has been STARTED or STOPPED. The readiness of a pool to be used by encodings, can't be determined automatically yet. In general, after starting a pool, depending on the cloud provider and region, it can take ~ 5 minutes before it is ready to use.
  • targetPoolSize is limited to the number of available encoding slots to your Bitmovin Account.

Create a PoolLink Icon

Required Pool Configuration Properties:

  • encoderVersion - An explicitely defined encoder version for this pool. Only encodings that are configured to use the same encoder version can take resources from this pool.
  • cloudRegion - An explicitely defined cloud region of a cloud provider for this pool. Only encodings that are configured to use the cloud region can take resources from this pool.
  • targetPoolSize - The number of encoding resources the pool has to keep available at all times. If one is taken from the pool, it "refill"s a new one automatically.
  • diskSize - (500GB|1000GB|2000GB) available to the encoding resource. The appropriate size depends on the use-case you are dealing with. E.g. when processing mainly small input files with a typical encoding profile, 500GB are usually sufficient. Workflows creating big progressive Outputs or dealing with RAW or Mezzanine files should use 1000GB or more.

Bitmovin API SDK for Java Example: (API-Reference | Github)

1PrewarmedEncoderPool poolToCreate = new PrewarmedEncoderPool();
2poolToCreate.setName("Fast-Track Encodings");
3poolToCreate.setDescription("Use for encodings that have to be done immediately");
4poolToCreate.setEncoderVersion("2.54.0");
5poolToCreate.setCloudRegion(CloudRegion.AWS_EU_WEST_1);
6poolToCreate.setDiskSize(PrewarmedEncoderDiskSize.GB_500);
7poolToCreate.setTargetPoolSize(1);
8
9PrewarmedEncoderPool createdPool = bitmovinApi.encoding.infrastructure.prewarmedEncoderPools.create(poolToCreate);

Start a PoolLink Icon

Once created, you can start a pool by issuing the start API Call:

Bitmovin API SDK for Java Example: (API-Reference | Github)

1bitmovinApi.encoding.infrastructure.prewarmedEncoderPools.start(createdPool.getId());

Wait for Pool to be Up and Running

As mentioned in "Known Limitations", only STARTED and STOPPED is available to reflect the status of a pool right now. Therefore, its recommended to wait for a few minutes (~5min) before the pool is ready to use, after being started.

Check the Status of a PoolLink Icon

As its an asynchronuos process, you can check the status of a pool accordingly like this:

Bitmovin API SDK for Java Example: (API-Reference | Github)

1bitmovinApi.encoding.infrastructure.prewarmedEncoderPools.get(createdPool.getId());

Its either STOPPED, or STARTED. As mentioned at "Known Limitations", the readiness of a pool to be used by encodings, can't be determined automatically yet. In general, after starting a pool, depending on the cloud provider and region, it can take ~ 5 minutes before it is ready to use.

Start an Encoding using a PoolLink Icon

Bitmovin API SDK for Java Example: (API-Reference | Github)

1Encoding encoding = new Encoding();
2encoding.setEncoderVersion("2.58.0");
3encoding.setCloudRegion(CloudRegion.AWS_EU_WEST_1);
4
5...
6//your encoding configurations...
7...
8
9//Start an Encoding with StartEncodingRequest Configuration
10Scheduling scheduling = new Scheduling();
11scheduling.setPrewarmedEncoderPoolIds(array.asList(createdPool.getId()));
12StartEncodingRequest startEncodingRequest = new StartEncodingRequest();
13startEncodingRequest.setScheduling(scheduling);
14
15bitmovinApi.encodings.start(encoding.getId(), startEncodingRequest);

Stop a PoolLink Icon

If a pool is no longer needed at the moment, you can stop using the stop API call. Once issued, the pool immediately starts to gracefully de-provision all its idle encoding resources.

Hint: Already running encodings, using resources from a stopping pool, will continue to run and its resources will be de-provisioned as soon as they have successfully finished.

Bitmovin API SDK for Java Example: (API-Reference | Github)

1bitmovinApi.encoding.infrastructure.prewarmedEncoderPools.stop(retrieved.getId());

Delete a PoolLink Icon

If a pool is no longer needed, it can be deleted. A pool has to be STOPPED first, before it can be deleted.

Bitmovin API SDK for Java Example: (API-Reference | Github)

1bitmovinApi.encoding.infrastructure.prewarmedEncoderPools.delete(createdPool.getId());

Schedule the START/STOP for a poolLink Icon

Required Properties:

  • action - (START|STOP) Determines if the pool shall be started or stopped
  • triggerDate - The date and time in the future (at least a full minute) the action shall be executed at. The scheduling time is on a per-minute basis, so seconds and milliseconds are not respected by the scheduling.

Bitmovin API SDK for Java Example: (API-Reference | Github)

Schedule the Start of a Pool

1Date poolStartDate = new DateTime(2020, 11, 20, 9, 0, 0).toDate();
2
3PrewarmedEncoderPoolSchedule poolSchedule = new PrewarmedEncoderPoolSchedule();
4poolSchedule.setAction(PrewarmedEncoderPoolAction.START);
5poolSchedule.setTriggerDate(poolStartDate);
6
7PrewarmedEncoderPoolSchedule createdPoolSchedule =
8bitmovinApi.encoding.infrastructure.prewarmedEncoderPools.schedules.create(
9createdPool.getId(), poolSchedule);

Schedule the Stop of a Pool

1Date poolStopDate = new DateTime(2020, 11, 20, 17, 0, 0).toDate();
2
3PrewarmedEncoderPoolSchedule poolSchedule = new PrewarmedEncoderPoolSchedule();
4poolSchedule.setAction(PrewarmedEncoderPoolAction.STOP);
5poolSchedule.setTriggerDate(poolStopDate);
6
7bitmovinApi.encoding.infrastructure.prewarmedEncoderPools.schedules.create(
8retrieved.getId(), poolSchedule);

Delete a scheduled START/STOP of a PoolLink Icon

Bitmovin API SDK for Java Example: (API-Reference | Github)

1bitmovinApi.encoding.infrastructure.prewarmedEncoderPools.schedules.delete(createdPool.getId(),createdPoolSchedule.getId());

Give us feedback