Skip to content

Commit

Permalink
Introduce control over how often SolidCable queries db
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Nov 7, 2024
1 parent 508b526 commit 4b86568
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ RAILS_ENV=development
MAX_THREADS=2
WEB_CONCURRENCY=2

# How often should SOLID_CABLE poll the database for new ActionCable messages.
# You may need to dial it back if you are overloading the database.
SOLID_CABLE_POLLING=0.1.seconds


# This makes Quepid run only on SSL, including all interactions
# with search engines on SSL. If FORCE_SSL is false, then Quepid will switch
# between http and https based on the url of the search engine for the main
Expand Down
8 changes: 4 additions & 4 deletions config/cable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ development:
#connects_to:
# database:
# writing: cable
polling_interval: 5.seconds
polling_interval: <%= ENV.fetch("SOLID_CABLE_POLLING", '0.1.seconds') %>
message_retention: 1.day
silence_polling: false
silence_polling: true

test:
adapter: test
Expand All @@ -24,6 +24,6 @@ production:
#connects_to:
# database:
# writing: cable
polling_interval: 5.seconds
polling_interval: <%= ENV.fetch("SOLID_CABLE_POLLING", '0.1.seconds') %>
message_retention: 1.day
silence_polling: false
silence_polling: true
8 changes: 8 additions & 0 deletions docs/operating_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This document explains how Quepid can be operated and configured.
- [Setting up a Context Path](#setting-up-a-context-path)
- [Mail](#mail)
- [OAuth](#OAuth)
- [Managing Websocket Load](#managing-websocket-load)
- [Legal Pages & GDPR](#legal-pages-&-gdpr)
- [User Tracking](#user-tracking)
- [Heathcheck Endpoint](#healthcheck)
Expand Down Expand Up @@ -148,6 +149,13 @@ We *assume* that the client definition in Keycloak will be named `quepid`, you c

Keycloak 17+ removes the `/auth` portion of the url. If you are using earlier versions of keycloak, you need to set `base_url:'/auth'` in devise.rb.

## Managing Websocket Load

Quepid uses [SolidCable]() to back the websocket messaging that drives some asynchrnous communication. The state is managed in the database.

By default we issue a query every tenth of a second, which can overload your database.

Set `SOLID_CABLE_POLLING` to `1.seconds` or even `5.seconds` to change how often updates are checked for. The default is `0.1.seconds`.


## Legal Pages & GDPR
Expand Down

0 comments on commit 4b86568

Please sign in to comment.