Commit graph

19 commits

Author SHA1 Message Date
SergeantPanda
38c89402f8 Enhancement: Update psycopg2 to 3. 2026-05-28 19:46:58 -05:00
SergeantPanda
c33d456743 Enable gevent in uWSGI workers; fix WS delivery and DB exhaustion
- Enable gevent cooperative multitasking in all uWSGI worker configs
  (gevent-early-monkey-patch + import dispatcharr.gevent_patch)
- Rewrite WebSocket group sends to bypass asyncio in gevent workers:
  _gevent_ws_send() replicates the channels_redis 4.x wire format
  directly via synchronous Redis so send_websocket_update() and
  _send_async() no longer fail silently after epoll is patched out
- Fix PostgreSQL connection exhaustion: CONN_MAX_AGE=0 + explicit
  close_old_connections() in stream manager and cleanup watchdog loops
- Fix stream proxy race: register client before the connect-wait loop
  so the cleanup watchdog never sees zero clients on a live channel
- Channel list/logo/profile queryset optimisations: conditional DISTINCT,
  EXISTS semi-joins for filter-options, channel_count annotation to
  eliminate N+1 in LogoSerializer, prefetched memberships in
  ChannelProfileSerializer
- JsonResponse for channel ID list and summary endpoints
2026-05-14 18:55:09 -05:00
SergeantPanda
c956672587 Enhancement: Route long-running DVR recordings to a dedicated queue. 2026-04-26 09:34:20 -05:00
dekzter
90a600b48f merged in dev 2026-03-26 12:17:43 -04:00
Jeff Casimir
4796184a67 Fix uWSGI segfaults by disabling threads when using gevent
Mixing threading and gevent concurrency models causes uWSGI workers to
crash with segmentation faults, particularly on ARM64/Python 3.13.

The production uwsgi.ini was already correct (gevent without threads).
This fixes the dev and debug configs to match.

References:
- https://github.com/gevent/gevent/issues/1784
- https://github.com/unbit/uwsgi/issues/2457

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 14:02:39 -07:00
dekzter
dba70b3c58 outstanding commits, may revisit later 2026-01-27 15:23:07 -05:00
SergeantPanda
119b222428 Enhancement: Allow setting both Celery and UWSGI nice levels. Default nice levels are UWSGI=0, Celery=5. Added documentation to the compose files on how to use it. Using nice levels for UWSGI allows us to have streaming run at a high priority. 2025-10-21 10:11:53 -05:00
SergeantPanda
134093b18e Enhancement: Add 'nice -n 5' to celery commands in configuration files for better process priority management 2025-09-27 15:32:29 -05:00
SergeantPanda
6ce387b0b0 Auto-scales Celery based on demand. Should lower overall memory and CPU usage while allowing for high cpu demand tasks to complete quickly.
Closes #111
2025-06-02 18:03:32 -05:00
SergeantPanda
303123f3ec Buffer overflow error. 2025-05-21 09:44:09 -05:00
SergeantPanda
44a79d2a8a Log UWSGI if debug is set (DISPATCHARR_DEBUG=true) 2025-05-14 18:49:46 -05:00
SergeantPanda
24fba3c2b1 Change some celery tasks from info to debug. 2025-05-10 09:58:57 -05:00
SergeantPanda
58773c015c Modify logging levels of uwsgi and fix epg tasks not being deleted when epg is deleted. 2025-05-08 19:47:05 -05:00
dekzter
4ede62d886 limit celery workers - need to make this configurable 2025-04-02 16:28:19 -04:00
SergeantPanda
efaa7f7195 Singular redis-client. 2025-03-21 10:55:13 -05:00
dekzter
7a7cd0711d live stats dashboard 2025-03-17 12:42:58 -04:00
dekzter
85b8f6194e updated uwsgi for dev 2025-03-11 20:34:48 -04:00
dekzter
81978e22d5 first run at mantine 2025-03-10 20:54:06 -04:00
dekzter
84e73b9415 dev mode of uwsgi 2025-03-05 19:00:13 -05:00