feat: Limit the rate at which a conference adds endpoints to a bridge - #1298
Merged
Conversation
Adds an optional per-(bridge, conference) limit on the number of endpoints that a conference may add to a bridge within an interval (max-bridge-participants-per-interval, disabled by default). A bridge reports its stress level only every 5-10 seconds, so during a burst of joins the reported stress (and therefore correctedStress) is stale by construction, and selection keeps using the same bridge long after it is full. Limiting the rate of growth bounds the overshoot, while leaving a conference which grows slowly, and many small conferences sharing a bridge, unaffected. The rate is tracked per colibri2 session, so its lifecycle matches the (conference, bridge) pair exactly. It is exposed to selection via ConferenceBridgeProperties and checked alongside max-bridge-participants, so neither correctedStress nor Bridge.isOverloaded change, and the behavior for other conferences is unaffected.
jitsi-ci Bot
pushed a commit
to jitsi/jitsi-pr-tests-pages
that referenced
this pull request
Aug 6, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1298 +/- ##
==========================================
+ Coverage 50.47% 50.98% +0.50%
==========================================
Files 131 131
Lines 8251 8285 +34
Branches 1261 1268 +7
==========================================
+ Hits 4165 4224 +59
+ Misses 3493 3465 -28
- Partials 593 596 +3
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
JonathanLennox
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an optional per-(bridge, conference) limit on the rate at which a conference adds endpoints to a bridge:
jicofo.bridge.max-bridge-participants-per-interval(default-1, i.e. disabled) overjicofo.bridge.max-bridge-participants-interval(default 1 minute). A suggested production value is 30.Why
A bridge reports its stress level via presence only every 5-10 seconds. During a burst of joins the reported stress, and therefore
correctedStress, is stale by construction, and selection keeps assigning to the same bridge long after it is full. Observed in production: a conference added 92 endpoints in 31 seconds, 58 of them landing on a single bridge which reached a real stress of 1.1, while 9-11 operational bridges in the same pool stayed below 0.05 stress. The logged stress for the overloaded bridge stayed frozen at 0.008 across ~15 consecutive selection decisions.Rate is a better discriminator than a count:
How
RateTrackeronColibri2Session, which is exactly one object per (conference, bridge), so its lifecycle needs no extra bookkeeping: it is created with the session and dies with it (conference expiry, last endpoint leaving the bridge, bridge removal).ConferenceBridgeProperties, and is checked in the private mergedBridge.isOverloaded(conferenceBridges)next tohasMaxParticipantsInConference, so every selection strategy inherits it.conferenceBridgesand config, neverBridge, socorrectedStress, the bareBridge.isOverloaded, bridge sorting,hasNonOverloadedBridge()and load redistribution are unchanged. Behavior for other conferences is unaffected.leastLoadedNotMaxedAlreadyInConference) intentionally does not honor the limit. It exists to return some bridge rather than fail an allocation, and the limit is a spreading heuristic, not a capacity limit.max-bridge-participantsstays in effect as the hard cap.bridge_selection_rate_limited), and the per-session count is exposed in the debug state.Also fixes a fidelity gap in
TestColibri2Server, which ignored the conference-levelexpireflag and so never let a bridge be re-used after its session was torn down.