AWS for M&E Blog
Data-driven approach: Optimizing on-demand cost of AWS Elemental MediaLive
In the dynamic world of live video streaming, optimizing costs while maintaining high-quality service is a constant challenge for media companies. Amazon Web Services (AWS) Elemental MediaLive, a cloud-based live video processing service, offers flexible pricing options to help address this challenge. However, determining the right balance between on-demand and reserved instances requires careful analysis of usage patterns.
We’ll guide you through a data-driven approach to managing MediaLive reservations. Leveraging the power of AWS Cost and Usage Reports (AWS CUR) and Amazon QuickSight you’ll gain insights into your MediaLive usage. This will help you make informed decisions about reservations and potentially reduce costs.
Before diving into the analysis, let’s review the pricing options for AWS Elemental MediaLive:
- On-Demand pricing: Pay only for the resources you use, you pay an hourly rate for running inputs, outputs, and add-on features. This option provides maximum flexibility but may result in higher costs for consistent usage.
- Reserved pricing: Commit to using MediaLive for a 12-month term in exchange for up to a 70 percent discount compared to on-demand pricing. This option can lead to substantial savings for predictable workloads.
The key to optimizing costs is finding the right mix of on-demand and reserved instances based on your specific usage patterns.
Prerequisites
The following needs to be in place before attempting the solution:
- To visualize MediaLive spend, you will need appropriate permissions to access AWS CUR, Amazon Athena and QuickSight. You should follow the least privilege model when using AWS Identity and Access Management (IAM), refer to the IAM security best practices documentation and conduct your own due diligence when setting this up.
- Enable AWS CUR, if not enabled. For instructions read: Creating Cost and Usage Reports.
- The AWS CUR granularity has to be hourly to implement this solution. The hourly granularity of the cost and usage report data is necessary to accurately analyze the usage patterns and make informed reservation decisions for your MediaLive workloads.
- Set up Athena to analyze the data from your S3 bucket holding AWS CUR data. For instructions read: Querying Cost and Usage Reports using Amazon Athena.
- Set up QuickSight to visualize the data from your Athena view. For instructions read: Setting up for Amazon QuickSight.
Solution
Create an Amazon Athena database for the AWS CUR data
If this is the first time you are using AWS CUR data with Athena, you will need to create the Athena database and table with AWS CUR data. To do this follow either of the ensuing steps:
- Use AWS CloudFormation (recommended) to integrate AWS CUR with Athena.
Or
- Follow the approach of manually creating Athena Tables. You will need to repeat this step at least once a month, as the table only includes data from the current AWS CUR.
Create an Amazon Athena view of AWS CUR data for querying the information
An Athena view is a logical table, allowing users to save SQL queries as virtual tables that pull the latest data from underlying sources each time they’re queried.
- To create the “eml_od_usage” view, copy the SQL query from CUR Query Library (MediaLive OnDemand Usage) in the Athena editor.
- The query contains ${table_name} as the placeholder which must be replaced before a query will run. For example, if your AWS CUR table is called cur_table and is in a database called cur_db, you would replace ${table_name} with cur_table.
- Add the following statement to the beginning of the query and hit run.
CREATE OR REPLACE VIEW "eml_od_usage" AS
This view will provide the necessary data to build the QuickSight dashboard and visualize the spend of MediaLive over time.
Configure Amazon QuickSight to access the Amazon Athena view
Next, to access the Athena view in Amazon QuickSight, Create a QuickSight dataset using Amazon Athena views.
- Add “eml_od_usage” view from Amazon Athena views to Amazon QuickSight as the datasets.
- Select “Query mode” as SPICE. Click PUBLISH & VISUALIZE, this is will create a new QuickSight Analysis.
- Once the dataset is added, add the refresh schedule, so the dataset receives new data from the AWS CUR. It is highly recommended to refresh the dataset daily or weekly for a better visualization experience.
Create visuals of your AWS Elemental MediaLive reservation
Now that we have added the dataset, we are going to add visuals to the newly opened analysis. QuickSight Analysis is a feature within Amazon QuickSight that allows users to create interactive visualizations and perform data analysis on datasets. It enables users to explore data through charts, tables, and dashboards, offering insights with filtering, calculations, and custom views.
Follow these steps to add visuals to the analysis:
- Start from the Analysis page, we’ll add a “On Demand Spend by Account IDs” visual.
- In the left sidebar, click the Add button in the “Visuals” section.
- Select Pie Chart as the visual type.
- In the “Data” column make sure you have eml_od_usage selected (Figure 5).
- In the field list, select line_item_usage_account_id and sum_line_item_unblended_cost.
- Change “sum_line_item_unblended_cost” to Sum by using a field well.
- Staying on the same Analysis page, we’ll add an “On Demand Cost by Account ID and Usage Type” visual.
- In the left sidebar, click the Add button in the “Visuals” section.
- Select Table as the visual type.
- In the “Data” column make sure you have eml_od_usage
- In the field list, select line_item_usage_account_id, line_item_usage_type, round_sum_line_item_usage_amount and sum_line_item_unblended_cost.
- Change “round_sum_line_item_usage_amount” and “sum_line_item_unblended_cost” to Sum by using a field well.
- Continuing on your Analysis page, we’ll add a “Reservation Recommendations by Usage Type” visual.
- In the left sidebar, click the Add button in the “Visuals” section.
- Select Table as the visual type.
- In the “Data” column make sure you have eml_od_usage
- In the field list, select line_item_usage_type, round_sum_line_item_usage_amount, sum_line_item_unblended_cost and Count of recommended reservations.
- Change “round_sum_line_item_usage_amount” and “sum_line_item_unblended_cost” to Sum by using a field well.
- Change “count of recommended reservations” to Average by using a field well.
- On the same Analysis page, we’ll add a “Count of recommended reservations and On Demand Spend” visual.
- In the left sidebar, click the Add button in the “Visuals” section.
- Select Line Chart as the visual type.
- In the “Data” column make sure you have eml_od_usage
- In the field list, select line_item_usage_end_date, count of recommended reservations and sum_line_item_unblended_cost.
- Aggregate “line_item_usage_end_date” by WEEK.
- Change “count of recommended reservations” to Average by using a field well.
- Change “sum_line_item_unblended_cost” to Sum by using a field well.
After successfully following the previous steps, you will have an analysis created as shown in Figure 9. This analysis provides a comprehensive view of your AWS Elemental MediaLive on-demand usage and reservation recommendations categorized by accounts and usage types.
You can publish as a dashboard and share with the responsible personas to analyze the spend and utilization of the MediaLive reservations.
Making data-driven reservation decisions
With these insights, you can strategically approach your MediaLive reservation decisions with confidence. Start by identifying usage types that demonstrate consistent, high usage patterns, as these make ideal candidates for reservations. Take time to carefully analyze your daily usage patterns and consider future growth to determine reservation terms.
When building your business case, leverage the clear cost comparisons between on-demand and potential reserved pricing to demonstrate tangible savings to stakeholders. However, remember that maintaining operational flexibility is crucial—aim to strike an optimal balance between reserved and on-demand instances in your portfolio. This hybrid approach validates you can efficiently handle both your predictable baseline workloads and any variable spikes in demand, maximizing both cost savings and operational agility.
Implementing and monitoring your reservation strategy
After finalizing your MediaLive reservation strategy, begin by purchasing your selected reservations through either the AWS Management Console or API. To maintain optimal efficiency, implement a robust monitoring system using AWS CUR data and QuickSight dashboards to track your reservation utilization.
Stay proactive by establishing alerts that notify you of any under-utilized reservations or unexpected surges in on-demand usage. Remember that usage patterns naturally evolve over time, so make it a priority to regularly review and adjust your reservation strategy. This ongoing assessment verifies your MediaLive infrastructure continues to deliver maximum value and cost-effectiveness for your organization.
Conclusion
By leveraging AWS Cost and Usage Reports data and Amazon QuickSight visualizations, you can optimize your AWS Elemental MediaLive costs through strategic use of reservations. This data-driven approach confirms that you’re making informed decisions that balance cost savings with the flexibility needed for your media processing workloads.
Remember, the key to successful cost optimization is ongoing analysis and adjustment. Regularly revisit your AWS CUR data, QuickSight dashboards, and reservation strategy to confirm you’re always getting the most value from your MediaLive usage.
To learn more about AWS Elemental MediaLive and its pricing options, visit the AWS Elemental MediaLive pricing page. Contact an AWS Representative to know how we can help accelerate your business.