livepeer_bench
tool and the
common output rendition configuration
transcodingOptions.json
you stored during the benchmarking, you can work with
this guide to fine tune your configuration:
- Calculate session limits
- Evaluate hardware capacity
- Benchmark transcoding for a range of concurrent sessions
- Evaluate bandwidth
- Derive a session limit
- Set session limits
It is recommended you complete the steps in benchmark
transcoding guide before
proceeding.
Session Limits
The default limit of concurrent sessions is set to 10. When this limit is exceeded, the orchestrator returns an error,OrchestratorCapped
, to the
gateway and transcoders and they will stop receiving work from
orchestrators. The session limit should then be set depending on available
hardware and bandwidth.
Calculating session limits
The session limit is an estimate and may require adjustments after running live on the network. The bandwidth and computational power needed to transcode a video stream varies with the source video and requested output configuration. Session limits are passed through the-maxSessions
parameter to the node where
they should be set based on taking the minimum of:
- Transcoding Hardware, and
- Bandwidth
Set Session Limits
The following steps require that incoming streams are configured with the common web video streaming Adaptive Bitrate (ABR) ladder on the Livepeer network. Session limits can be similarly calculated for a different ABR ladder.-
Evaluate hardware
The recommendation for determining a hardware level limit is to use the
concurrent sessions value of the last log indicating that the real-time
duration ratio
X
was less than or equal 0.8. This leaves a ~20% buffer for upload/download within real-time.
- You can use the following script with the
livepeer_bench
tool to benchmark transcoding for a range of concurrent sessions:
- Transcoding with multiple identical Nvidia GPUs: Benchmarking with a single GPU should suffice and then you can multiply the limit for a single GPU by the number of available GPUs. If you are transcoding multiple different Nvidia GPUs, you should benchmark each unique GPU and determine a limit that is specific to that GPU.
-
Adjust the loop range (
{1..20}
) to reflect the maximum number of concurrent sessions you want to benchmark. If at 20 maximum concurrent sessions real-time duration is still below 1.0, you should increase the maximum number of concurrent sessions. -
View the final output in a file called
bench.log
.
If you are transcoding with a CPU, you will likely want to lower the value of
the maximum number of concurrent sessions (i.e. 5).
- Evaluate bandwidth
1080p30fps
):
- Download Bandwidth = 6 Mbps Per Stream. This is about 6000 kbps for downloading the source rendition.
- Upload Bandwidth = 5.6 Mbps Per Stream. This is about 5600 kbps for uploading the output rendition.
- To estimate the number of streams you can process, divide the above from your network provider’s limits.
upstream/downstream
speed of 100 Mbps
should reliably be able to serve/process ~16 streams.
However, as not all streams’ segments may be processed at the same time, you may
be able to extend this by an additional ~20%.
Bandwidth requirements
provides further information about testing your available upload/download
bandwidth.
- Derive a session limit based on hardware and bandwidth
-maxSessions
flag.
Session management in orchestrators and transcoders is still constantly being
improved. Your mileage may vary with this approach; you may find that your
orchestrator or transcoder performance may be affected with a higher session
limit.
Further adjusting the session limit values after performing work on the network
may be necessary.
- Set session limits
-maxSessions
flag is used to set session limits on both orchestrators and
transcoders.
For Example:
For a combined orchestrator and transcoder, set the session limit to 30: