update default configuration files

(cherry picked from commit 7a7b37c1ea3028fc8897827b61a6b1d737b8ce1e)
This commit is contained in:
Benjamin Wiegand
2024-11-21 11:15:24 -08:00
parent 5b06c8392e
commit 18709af018
3 changed files with 75 additions and 29 deletions
+5 -5
View File
@@ -67,7 +67,7 @@ POLL_CHECK_FLAGS = POLLIN | POLL_DEATH_FLAGS
# config defaults
DEFAULT_ANSI_LOGGING = False
DEFAULT_ANSI_LOGGING = True
DEFAULT_LOG_LEVEL = 3
DEFAULT_SESSION_SERVER_TIMEOUT = 5
DEFAULT_SESSION_SERVER_SOCKET = '/run/staged/session.socket'
@@ -75,10 +75,10 @@ DEFAULT_SESSION_SERVER_SOCKET = '/run/staged/session.socket'
DEFAULT_SENDER_THREADS = 4
DEFAULT_LISTENER_THREADS = 4
DEFAULT_CMD_QUEUE_SIZE = 20
DEFAULT_CMD_QUEUE_SIZE = 200
DEFAULT_WS_QUEUE_SIZE = 4
DEFAULT_EVENT_QUEUE_SIZE = 20
DEFAULT_EVENT_QUEUE_SIZE = 300
DEFAULT_CLICK_QUEUE_TTL = 5
DEFAULT_SESSION_QUEUE_TTL = 7
@@ -86,8 +86,8 @@ DEFAULT_SESSION_QUEUE_TTL = 7
DEFAULT_POLL_TIME = 10
DEFAULT_WS_POLL_TIME = 5
DEFAULT_MAINTENANCE_INTERVAL = 60
DEFAULT_SESSION_TIMEOUT = 500
DEFAULT_MAINTENANCE_INTERVAL = 30
DEFAULT_SESSION_TIMEOUT = 300
DEFAULT_CORS_ORIGIN_HEADER_VALUE = ''
+7 -11
View File
@@ -6,7 +6,7 @@
# unix socket that the session server listens from.
session_server_socket: '/tmp/aaaaaaaasock'
# timeout in seconds for communications between the session server and the uwsgi app.
# this should be low, since the session server is supposed to be fast.
# this should be low to avoid slow events at peak server capacity.
session_server_timeout: 5
# use ansi colors in logs.
@@ -62,7 +62,7 @@ listener_threads: 4
# maximum number of commands in the command queue before new commands are rejected.
# setting this too low will keep the server responsive, but may drop click events.
# setting this too high may increase latency under heavy load, but increase the user capacity.
cmd_queue_size: 20
cmd_queue_size: 200
# maximum number of events in the event queue for a websocket before new events are rejected.
# setting this too low is better than too high.
@@ -97,23 +97,19 @@ cors_origin_header_value: 'http://localhost:5500'
# the maximum number of events in the event queue PER CONNECTED LISTENER before new ones are rejected.
# this is per listener connection, so it multiplies for the listener count for every uwsgi process for every
# uwsgi instance currently connected to the session server.
event_queue_size: 20
event_queue_size: 300
# interval in seconds at which the maintenance thread should execute.
# the maintenance thread is currently just responsible for expiring inactive sessions.
maintenance_interval: 30
# interval in seconds at which to ping the uwsgi app to ensure the client is still connected.
# if this ping succeeds, the session activity timestamp is updated.
# too small of a value will cause unnecessary load,
# too large of a value may reduce the inactivity grace period.
ping_interval: 30
maintenance_interval: 30 # for normal testing and stress-tests
#maintenance_interval: 5 # for session expiration testing
# time threshold in seconds from the last contact with the presenting device at which the maintenance thread will
# consider a session inactive and expire it.
# too low may be annoying for users,
# too high may enable denial of service attacks by making a bunch of sessions
session_timeout: 300
session_timeout: 300 # for normal testing and stress-tests
#session_timeout: 2 # for session expiration testing
# export metrics via prometheus (requires restart)
prometheus:
+63 -13
View File
@@ -1,12 +1,12 @@
# sample config file. it's shared between the session server and the uwsgi app
# todo: update this
# ===================== common =====================
# unix socket that the session server listens from. (requires restart)
# unix domain socket that the session server listens from. (requires restart)
session_server_socket: '/run/staged/session.socket'
# timeout in seconds for communications between the session server and the uwsgi app.
# this should be low, since the session server is supposed to be fast.
# this should be low to avoid slow events at peak server capacity.
session_server_timeout: 5
# use ansi colors in logs.
@@ -22,6 +22,25 @@ ansi_logging: true
# -1 = silence
log_level: 3
# time in seconds that connection pools should poll the queue/socket for before checking
# the connection health.
#
# setting this low is better for testing or low user counts, as it will reduce the chance for
# users to get hit with an "internal server error" after one of the services restarts.
# if everything is set in stone, and you're not restarting anything, it's safe to set this a bit
# higher to reduce idle load.
poll_time: 10
# queue ttl parameters.
# the time to live (in seconds) for various types of events/commands to live in the queue before
# they are auto-rejected by the connection pool.
#
# setting these higher will obviously allow longer latency and increase server capacity, but
# don't set them too high. imagine you're a user, you click and nothing happens, but 20 seconds later
# after you give up it finally goes through and messes up your presentation. that would be pretty annoying.
click_queue_ttl: 5
session_queue_ttl: 7
# ===================== uwsgi app =====================
@@ -40,19 +59,50 @@ log_level: 3
sender_threads: 4
listener_threads: 4
# maximum number of commands in the command queue before new commands are rejected.
# setting this too low will keep the server responsive, but may drop click events.
# setting this too high may increase latency under heavy load, but increase the user capacity.
cmd_queue_size: 200
# maximum number of events in the event queue for a websocket before new events are rejected.
# setting this too low is better than too high.
# normally, the user shouldn't be clicking fast enough to populate more than 2 events in the queue,
# but high server load may change that.
websocket_queue_size: 4
# poll_time but for the presenter's websocket loop.
# this may need to remain low, as this is the interval at which the websocket connection status is checked, and
# websocket commands are read.
# setting this too high will increase the time that these loops remain running after the websocket disconnects,
# and increase websocket command latency
websocket_poll_time: 5
# maximum amount of time in milliseconds that the clicker socket connection will stay open without the clicker
# sending anything. this should be higher than 20 seconds, since the clicker pings every 20 seconds
clicker_inactivity_timeout: 60000
# buffer size for nonces for clicker socket
# this number is reported to the clicker, and specifies how many unique nonce values can be sent before the first
# nonce is accepted again. making this greater than 254 is guaranteed to break everything because there are only 255
# possible nonce values and NULL is reserved
clicker_nonce_buffer_size: 5
# CORS header value
# this is primarily here for development purposes. you should preferably define headers in your nginx config.
# an empty value sends no cors origin header (default)
#cors_origin_header_value: ''
# ===================== session server =====================
# the maximum number of events in the event queue PER CONNECTED LISTENER before new ones are rejected.
# this is per listener connection, so it multiplies for the listener count for every uwsgi process for every
# uwsgi instance currently connected to the session server.
event_queue_size: 300
# interval in seconds at which the maintenance thread should execute.
# the maintenance thread is currently just responsible for expiring inactive sessions.
maintenance_interval: 30
# interval in seconds at which to ping the uwsgi app to ensure the client is still connected.
# if this ping succeeds, the session activity timestamp is updated.
# too small of a value will cause unnecessary load,
# too large of a value may reduce the inactivity grace period.
ping_interval: 30
# time threshold in seconds from the last contact with the presenting device at which the maintenance thread will
# consider a session inactive and expire it.
# too low may be annoying for users,
@@ -60,7 +110,7 @@ ping_interval: 30
session_timeout: 300
# export metrics via prometheus (requires restart)
prometheus:
export: True
port: 8000
addr: 127.0.0.1
#prometheus:
# export: True
# port: 8000
# addr: 127.0.0.1