Skip to content

Commit 963c4b6

Browse files
authored
Configurable cap to number of queued events when reconnecting WebSocket event handler (#3148)
1 parent a5c0c0b commit 963c4b6

File tree

2 files changed

+137
-105
lines changed

2 files changed

+137
-105
lines changed

conf/janus.eventhandler.wsevh.jcfg.sample

+22
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,28 @@ general: {
2323
backend = "ws://your.websocket.here"
2424
# subprotocol = "your-subprotocol"
2525

26+
# If the WebSocket server isn't reachable or the client has
27+
# to reconnect, the default behaviour of the handler plugin
28+
# is to retry with an exponential back-off, all while buffering
29+
# events that Janus may keep on pushing. Buffering has no
30+
# limit, so if reconnecting takes a long time (or forever)
31+
# memory usage will keep on growing; besides, it may cause
32+
# a network spike when eventually reconnected, as all stored
33+
# events would need to be sent to the backend before new
34+
# ones can be relayed as well. You can prune queued events
35+
# and put a cap on the amount of bufferint to perform when
36+
# reconnecting by setting the 'events_cap_on_reconnect'
37+
# property accordingly: any number you set will be the
38+
# maximum number of events stored in memory until we
39+
# reconnect, which means older packets will be discarded
40+
# if the cap is exceeded. Notice that setting a value
41+
# of 0 will not mean "drop all packets", but will disable
42+
# the cap (default behaviour), which means the minimum
43+
# possible value is 1. Also notice that, when the cap is
44+
# enabled, this means the event receiver may end up missing key
45+
# events when a reconnection actually ends up taking place.
46+
# events_cap_on_reconnect = 10
47+
2648
# In case you need to debug connection issues, you can configure
2749
# the libwebsockets debugging level as a comma separated list of things
2850
# to debug, supported values: err, warn, notice, info, debug, parser,

0 commit comments

Comments
 (0)