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
build: use FIFO scheduler in bbb-webrtc-sfu #15602
build: use FIFO scheduler in bbb-webrtc-sfu #15602
Conversation
bbb-webrtc-sfu (and mediasoup) are running in the CFS scheduler which means it has to compete with (much) lower priority tasks like presentation conversion, recording processing, [...] Since it encompasses an RTC application which also handles audio, it should be _at least_ on the same scheduling policy as FS/bbb-html5 - and that should be safer now with mediasoup which has a lower footprint (and generates lower CPU noise overall). This commit puts bbb-webrtc-sfu in the FIFO scheduling policy (same as bbb-html5). Also bumps bbb-html5 nice level up to 18 and sets SFU to nice 19 (so bbb-html5 has some advantage when push comes to shove). This can be improved further by using per-process priorities in SFU. Ideally we'd want mediasoup audio workers and mcs-core to be the same priority as FS (so higher than bbb-html5), but the rest of them (video/screen workers) to be the same or lower than bbb-html5. For future reference: - bigbluebutton/bbb-webrtc-sfu@3e24512 - bigbluebutton/bbb-webrtc-sfu@66d443d
Kudos, SonarCloud Quality Gate passed! |
Just an idea: Processes belonging to a service can be grouped by using systemd slices. That way a group of processes could be prioritized/limited not matter how many processes exist in a group. That way you can limit for example the cpu consumption of all html5 processes no matter how many are configured. And you can weight groups of processes, like all bbb-html5 processes to all bbb-webrtc-sfu and to all freeswitch ones. A slice hierarchy might look like this:
See https://www.man7.org/linux/man-pages/man5/systemd.slice.5.html and https://www.man7.org/linux/man-pages/man5/systemd.resource-control.5.html |
Neat. From the top of your head do you know if slices have a neat way of handling prioritization of child processes? Or does that only apply easily to parent processes? |
I don't know if I understood https://systemd.io/CGROUP_DELEGATION/ correctly. But I think it is possible to move processes into a systemd scope that belongs to a different slice than the managing process which forks off the processes. I found this one but did not try if it works: https://unix.stackexchange.com/questions/525740/how-do-i-create-a-systemd-scope-for-an-already-existing-process-from-the-command You can inspect the cgroup tree in your system by running |
I'll open a follow up issue for the improvements discussed here. |
What does this PR do?
bbb-html5). Also bumps bbb-html5 nice level up to 18 and sets SFU to
nice 19 (so bbb-html5 has some advantage when push comes to shove).
Closes Issue(s)
Closes #
Motivation
bbb-webrtc-sfu (and mediasoup) are running in the CFS scheduler which
means it has to compete with (much) lower priority tasks like
presentation conversion, recording processing, [...]
Since it encompasses an RTC application which also handles audio, it
should be at least on the same scheduling policy as FS/bbb-html5 - and
that should be safer now with mediasoup which has a lower footprint
(and generates lower CPU noise overall).
This can be improved further by using per-process priorities in SFU.
Ideally we'd want mediasoup audio workers and mcs-core to be the same
priority as FS (so higher than bbb-html5), but the rest of them
(video/screen workers) to be the same or lower than bbb-html5.
For future reference: