July 21, 2017

Making Optimal Deployment Choices for an Encoding System on AWS

by Karthikeyan N (Principal Engineer, Media Server Technologies)

Choose the right Amazon EC2 instance type and instance storage type to minimize OPEX and uniquely position your encoding workflow.

Global media companies and studios including Netflix, Amazon, 20th Century Fox and Warner Bros. are increasingly harnessing the cloud to deliver optimal quality video and audio streams in a scalable and easy manner. Amazon Web Services (AWS) has emerged as a popular choice for video encoding in public cloud systems. Even the largest streaming service – Netflix – has been deploying its encoding systems on AWS for the last five years to effectively scale its services.

THINKode, Ittiam’s ML based chunk adaptive encoder software, is also designed to run on AWS. In the process of deploying THINKode on AWS, we identified two key factors for optimizing the performance and deployment costs – the appropriate Amazon EC2 instance type and the Amazon instance storage type. These factors will critically influence the OPEX for any video encoding deployment on AWS.

AWS offers different instance families and types that vary in cost and capabilities. The process of selecting the optimal instance family for our use case can therefore be complex. To simplify our decision-making, we have been performing extensive tests and comparative studies to determine the most suitable option for encoding.
Take a look at our key findings.

Amazon EC2 instance family: Which one is for you?

We chose Compute Optimized (CO) instance family as it drives higher performance and is the best suitable for encoding tasks that are compute intensive. CO instances are clocked at a higher CPU frequency (2.9GHz) compared to other instances (~2.3GHz), and have higher ECUs per dollar.

Amazon EC2 instance families

  • General Purpose (GP)
  • Compute Optimized (CO)
  • Memory Optimized (MO)
  • Accelerated Computing Instances – GPU (ACI)
  • Storage Optimized (SO)

The two groups of CO instances – C3 and C4 – comprise different types of instances based on their exact hardware configuration.


  • High frequency Intel Xeon E5-2680 v2 (Ivy Bridge) processors
  • SSD storage and network storage (EBS)


  • High frequency Intel Xeon E5-2666 v3 (Haswell) processors, optimized specifically for EC2
  • No SSD, only network storage (EBS)

Going for the right Amazon EC2 instance group

Having concluded that CO is the most suitable instance family for encoding, our next step was to select the appropriate instance group for deployment – C3 or C4. We performed profiling experiments on comparable instances from each group and compared the performance with respect to the following parameters, which are critical for encoding.

Cloud storage access speed: A source file was downloaded and the encoded output was egressed to the cloud storage. Our goal was to find out if the total access speed is adequate to maximize the encoding performance.

Disk throughput: The source file, the intermediate files generated as part of the encoding process, and the encoded output were stored in the instance storage. We then checked if the disk throughput was sufficient.

Encoding performance: The encoding time was used to measure the performance of the encoding system.
Take a look at the various options available within the C3 and C4 instance families and their characteristics.

Based on the characteristics, we shortlisted c3.2xlarge and c4.2xlarge, both comparable in their processing capability, to represent their respective groups for profiling.

Cloud storage access speed

We used Amazon Simple Storage Service (Amazon S3) as the cloud storage type for content ingest/egress.

Disk throughput

Amazon EC2 provides the following instance storage options.

Amazon EC2 Instance Store: Access storage from disks physically attached to the host computer.

Amazon Elastic Block Store (Amazon EBS): Durable, block-level storage volumes that can be attached to a running instance.

Additionally, Amazon EBS provides the following volume types, which differ in performance characteristics and price.

Since the EBS volume type general purpose SSD (gp2) provides adequate performance at a lower price and hence the best balance between storage size, price and performance, we have used it further in our experiments.

Encoding performance

Our profiling experiments for all the parameters show that C4 instance group combined with EBS instance storage type will enable the best balance of performance and cost.

Choosing the exact C4 instance type

Our final task was to choose the exact instance type by measuring the encoding performance on different C4 instance types. We anticipated that the multi-core scalability of all the software elements in our workflow would affect the performance on high core count instances. In our experiments, we found a near-linear increase in performance from C4.large to C4.2xlarge. With the price also increasing linearly, C4.2xlarge seemed a good base to compare against even higher performance variants.


Based on our comparative tests, we conclude the following are the best deployment options on AWS for encoding:

Amazon EC2 instance family: Compute Optimized (CO), Group: C4, Type: c4.2xlarge

Amazon instance storage: EBS, Volume Type: General Purpose SSD (gp2)

For more insights, reach out to us @mkt@ittiam.com