Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to Performance Test in an HTTP Live Streaming Environment

DZone's Guide to

How to Performance Test in an HTTP Live Streaming Environment

This tutorial will show you how to perform a load test on an HLS platform and explores the nature of its .m3u8 extension.

· Performance Zone ·
Free Resource

Maintain Application Performance with real-time monitoring and instrumentation for any application. Learn More!

HTTP Live Streaming protocol is designed by Apple. It can send live and on‐demand audio or video to any device with HTTP Live Streaming (HLS) technology. By using this technology, Content Delivery Networks are used to host these types of contents by separating ordinary web servers from CPU consuming transactions. HTTP live streaming performance test is essential for its quality.

HLS is an adaptive bitrate technology for different bandwidths and resolutions. HLS files are divided into small files encoded using the mpg2_ts codec. The streams are mapped to the client in real time using a .m3u8 index file based on screen size and available bandwidth.

Let’s see how to do a load test on an HLS platform. HLS files have a .m3u8 extension and it’s important for you to understand its structure and responses.

  • Make an HTTP call to m3u8 files. The response is not something you see every day. It’s not an HTMLXMLor JSON It’s different. You receive the small HTTP chunks split by the CDN server.

web server HTTP Live Streaming Performance


Example:

#EXTM3U

#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=688301

http://url/1010qwoeiuryfg/0640_vod.m3u8


  • Capture m3u8 chunks by adding a Regular Expression Extractor to HTTP Sampler.

chunks HTTP Live Streaming Performance


By using this specific regular expression, we capture the numeric expression located in the responses like “0640_vod.m3u8”.

  • Make a request to these captures m3u8 file.

You may receive thousands of chunks, so you need to make a request to each one of them.

  • Add a ForEach Controller to make a request to all these chunks by setting the Input variable prefix to our Regular Expression Extractor’s Reference ForEach controller. It will work as a loop and iterate through all the received chunks.

foreach_controller HTTP Live Streaming Performance


  • Create a new HTTP sampler. Pass the chunk name captured in the previous request into the path of the new URL.

http_request HTTP Live Streaming Performance





We are ready to make a request to the captured chunks but one step is missing. That is, keeping the streaming alive.

  • Run your test once and see the output. You have another different response coming from the chunks.
#EXTM3U

#EXT-X-TARGETDURATION:10

#EXT-X-MEDIA-SEQUENCE:0

#EXTINF:10,

0640/06400.ts

#EXTINF:10,

0640/06401.ts

#EXTINF:10,

0640/06402.ts


  • Capture the “*.ts” keywords. So we create another Regular Expression Extractor and extract .ts files.

extract_ts_files HTTP Live Streaming Performance


  • ForEach controller, pass Streams variable as an input to it so you iterate in it.

streams HTTP Live Streaming Performance







  • Create an HTTP Sampler to make a request for these .ts links.

http_sampler HTTP Live Streaming Performance





Now run your JMX files and see the results flows like a charm. Don't forget, HLS tests require a wide range of bandwidth, so cloud platforms will help you execute those tests easily. So Happy load testing! Come to Loadium.io

jmx_files HTTP Live Streaming Performance

Please feel free to ask questions if you have any.

Collect, analyze, and visualize performance data from mobile to mainframe with AutoPilot APM. Learn More!

Topics:
jmeter ,performance testing ,apache jmeter ,load test ,apple ,hls ,http live streaming ,.m3u8

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}