diff --git a/src/main/java/org/jitsi/jicofo/bridge/Bridge.java b/src/main/java/org/jitsi/jicofo/bridge/Bridge.java index b6d04744f5..ebd536353a 100644 --- a/src/main/java/org/jitsi/jicofo/bridge/Bridge.java +++ b/src/main/java/org/jitsi/jicofo/bridge/Bridge.java @@ -55,12 +55,6 @@ public class Bridge */ public static final int MAX_TOTAL_PACKET_RATE_PPS = config.maxBridgePacketRatePps(); - /** - * The stress-level beyond which we consider a bridge to be - * overloaded/overstressed. - */ - private static final double OVERSTRESSED_THRESHOLD = .8; - private long failureResetThreshold; /** @@ -309,12 +303,11 @@ public double getStress() } /** - * @return true if the stress of the bridge is greater-than-or-equal to - * {@link #OVERSTRESSED_THRESHOLD}. + * @return true if the stress of the bridge is greater-than-or-equal to the threshold. */ public boolean isOverloaded() { - return getStress() >= OVERSTRESSED_THRESHOLD; + return getStress() >= config.stressThreshold(); } public int getLastReportedPacketRatePps() diff --git a/src/main/kotlin/org/jitsi/jicofo/bridge/BridgeConfig.kt b/src/main/kotlin/org/jitsi/jicofo/bridge/BridgeConfig.kt index 8dcfdab87c..a38b77032d 100644 --- a/src/main/kotlin/org/jitsi/jicofo/bridge/BridgeConfig.kt +++ b/src/main/kotlin/org/jitsi/jicofo/bridge/BridgeConfig.kt @@ -42,6 +42,9 @@ class BridgeConfig { } fun averageParticipantPacketRatePps() = averageParticipantPacketRatePps + val stressThreshold: Double by config { "$BASE.stress-threshold".from(JitsiConfig.newConfig) } + fun stressThreshold() = stressThreshold + companion object { const val BASE = "jicofo.bridge" @JvmField diff --git a/src/main/resources/reference.conf b/src/main/resources/reference.conf index 45594cc352..0105a0c9e6 100644 --- a/src/main/resources/reference.conf +++ b/src/main/resources/reference.conf @@ -7,6 +7,8 @@ jicofo { max-bridge-packet-rate = 50000 // The assumed average packet rate per participant. average-participant-packet-rate-pps = 500 + // The stress level above which a bridge is considered overstressed. + stress-threshold = 0.8 } // Configure the codecs and RTP extensions to be used in the offer sent to clients. codec {