cluster/websocket: Make websocket dispatcher queue size configurable

Limit the number WebSocket events queued from external clients to
dispatcher instances to produce back pressure to the clients if
Zeek's IO loop is overloaded.
This commit is contained in:
Arne Welzel 2025-04-16 16:59:05 +02:00
parent 6bd624d9b2
commit 011029addc
9 changed files with 45 additions and 10 deletions

View file

@ -46,5 +46,12 @@ event zeek_init()
assert Cluster::listen_websocket(ws_tls_opts_copy);
assert ! Cluster::listen_websocket(ws_opts_wss_port);
# Using a different max_event_queue_size fails, but using the default should work.
local ws_opts_qs = copy(ws_opts);
ws_opts_qs$max_event_queue_size = 42;
assert ! Cluster::listen_websocket(ws_opts_qs);
ws_opts_qs$max_event_queue_size = Cluster::default_websocket_max_event_queue_size;
assert Cluster::listen_websocket(ws_opts_qs);
terminate();
}