Open cbarburescu opened 1 year ago
I figured it out: the high bandhwidth usage comes from the segment size, which is 10s by default (and thus, 10 times bigger than the size per second).
The solution I found is to set the vod segments to the size of the gop, using the following configuration:
vod_segment_duration 2000;
vod_align_segments_to_key_frames on;
vod_manifest_segment_durations_mode accurate;
This can potentially reduce the size of a segment by 3 to 5 times, depending on your gop size (between 2 and 5 seconds).
@cbarburescu Interesting stats!
To further reduce bandwidth, you could use proxies, like caching segments, etc.
Hello,
I am testing this solution with a test video (1080p, 30 minutes long, bitrate 1700 kb/s), using HLS.
I am using artillery for testing, with max 10 simultaneous users and 1 concurrent downloaded segment/ user.
I am using 2 vms from google cloud, region europe-west4-a (Netherlands) - one for streaming and one for testing. I have limited the nic of the streaming vm at 200mbps (to replicate the real setup I will have - a baremetal server with a 200mbps connection).
I am monitoring the egress of the streaming vm, which constantly sits at 180 mbps:
My question is: what is consuming so much bandhwidth and how can I optimize it, in order to support more users on that connection? If I have a video with a bitrate of 2mb/s, then 10 users should generate an egress of 20mbps (not considering the metadata). I am puzzled why it is taking 9 times more (180 = 9 * 20 mbps).
Furthermore, if I load the video from a browser (location: Denmark)§ at the same time that I am doing the test, the loading time of the first segment is as longs as 5-6 seconds, compared to <1 second (when the test script does not run).
Nginx config file: