-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After HttpClient
processes HLS files over HTTPS, the process becomes highly CPU intensive
#54009
Comments
Sorry this fell through. /cc @brianquinlan @aam |
Do you see elevated network traffic on mobile/server as this request being processed on the server? |
@aam FWIW I merged another issue into this one which has a reproduction one could run (#54752). That issue is about generic slowness of HTTPS implementation. It might not be the same problem - but certainly a related one. I heave peeked a bit under the covers at our implementation and it certainly leaves an impression of being suboptimal. |
You can checkout this repo for reproduction: https://github.com/Tienisto/httpserver-benchmark |
Would be good to confirm that if original reporter could provide more information on repro steps. Somehow it looks more severe than generic slowness(which certainly also worth investigating) |
Thank you for the benchmark https://github.com/Tienisto/httpserver-benchmark. Using that I see that bumping up secure filter buffer size by 100x improves throughput number for 100mb file by over 2x on linux x64 desktop. Throughput for five runs of node.js client uploading 100mb file to dart server in MB/s all running locally on linux x64.
Release build of dart sdk is slower than product build (especially for smaller buffers) probably due to stack trace capturing during io service receive ports opening. Node.js server receiving same upload from same node.js client still almost 10x faster at ~350 MB/s on the same machine. |
AVPlayer/ExoPlayer was indirectly utilized from https://pub.dev/packages/video_player. Since the original Flutter interface did not support HLS, I used a modified version to accommodate it, although there are no changes to the core player itself. The Dart server runs on macOS Ventura 13.6.3, Intel Core i7, and mobile testing was performed using an emulator. The issue reproduces regardless of the mobile OS version. I haven't investigated the increase in traffic. However, there doesn't seem to be any indication of a delay in loading videos. I am not sure if this is the same problem discussed, as my issue is that the CPU usage remains high semi-permanently after the request completes. It may be that some trigger is activated by the slow HTTPS implementation, causing an infinite loop, though. |
dart info
)Start the server with the following program.
Requesting
/master.m3u8
from a mobile app video player (AVPlayer
orEXOPlayer
) towards this server may load to abnormally high CPU usage on the machine running the server. This elevated load will persist until the server is stopped.The following results were obtained after validation under several different conditions.
<video>
element in a browser, instead of a mobile app player, there was no occurrence of abnormally high CPU usage.HttpClient
used internally in the server to CupertinoClient, there was no occurrence of abnormally high CPU usage.I have also attached a snapshot of the Dart process where the problem is occurring.
The text was updated successfully, but these errors were encountered: