Skip to content
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

[MM-54335] Improve write concurrency for screen tracks #138

Merged
merged 5 commits into from May 22, 2024
Merged

Conversation

streamer45
Copy link
Contributor

Summary

Initial ceiling tests identified a bottleneck when writing screen tracks in large calls (> 250 participants). This is because the write loop runs on a single goroutine since we use a single output track. This results in the CPU not being utilized to the fullest and packets getting significantly delayed or even dropped.

To overcome the current limitation, this PR proposes to create N output tracks and concurrently write to them.

These changes are showing to improve overall performance and CPU utilization on our target instance (c7i.xlarge) by a factor of ~2.5, getting us from around 300 participants to 800 per call with near-zero packet loss.

Ticket Link

https://mattermost.atlassian.net/browse/MM-54335

@streamer45 streamer45 added 2: Dev Review Requires review by a core committer Do Not Merge Should not be merged until this label is removed labels May 8, 2024
@streamer45 streamer45 requested a review from cpoile May 8, 2024 00:00
@streamer45 streamer45 self-assigned this May 8, 2024
Copy link
Member

@cpoile cpoile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, nice improvement!

service/rtc/sfu.go Show resolved Hide resolved
@streamer45 streamer45 added 3: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels May 14, 2024
@streamer45 streamer45 added this to the v0.16.0 milestone May 14, 2024
@streamer45 streamer45 removed the Do Not Merge Should not be merged until this label is removed label May 22, 2024
@streamer45 streamer45 merged commit 742c888 into master May 22, 2024
2 checks passed
@streamer45 streamer45 deleted the MM-54335 branch May 22, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants