From a275ac8530b18c9ff88587683461d69fefcc9e7b Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Mon, 10 Mar 2025 16:22:06 -0500 Subject: [PATCH] Switched to using main uwsgi for proxy. --- docker/entrypoint.sh | 12 ----------- docker/nginx.conf | 2 +- docker/uwsgi.ts_proxy.ini | 42 --------------------------------------- 3 files changed, 1 insertion(+), 55 deletions(-) delete mode 100644 docker/uwsgi.ts_proxy.ini diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 6fea443d..305f061f 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -94,18 +94,6 @@ uwsgi_pid=$(pgrep uwsgi | sort | head -n1) echo "✅ uwsgi started with PID $uwsgi_pid" pids+=("$uwsgi_pid") -# Add TS proxy uwsgi (add this section) -echo "🚀 Starting TS proxy uwsgi (single worker)..." -ts_proxy_uwsgi_file="/app/docker/uwsgi.ts_proxy.ini" -su - $POSTGRES_USER -c "cd /app && uwsgi --ini $ts_proxy_uwsgi_file --pidfile /tmp/uwsgi_ts_proxy.pid &" -ts_uwsgi_pid=$(cat /tmp/uwsgi_ts_proxy.pid 2>/dev/null || pgrep -f "uwsgi.*ts_proxy" | sort | head -n1) -if [ -n "$ts_uwsgi_pid" ]; then - echo "✅ TS proxy uwsgi started with PID $ts_uwsgi_pid" - pids+=("$ts_uwsgi_pid") -else - echo "⚠️ Warning: Could not determine TS proxy uwsgi PID" -fi - # Wait for at least one process to exit and log the process that exited first if [ ${#pids[@]} -gt 0 ]; then echo "⏳ Waiting for processes to exit..." diff --git a/docker/nginx.conf b/docker/nginx.conf index 5880fb01..322980a4 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -34,7 +34,7 @@ server { # Route TS proxy requests to the dedicated instance location /proxy/ { - proxy_pass http://127.0.0.1:5657; + proxy_pass http://127.0.0.1:5656; proxy_http_version 1.1; proxy_set_header Connection ""; proxy_buffering off; diff --git a/docker/uwsgi.ts_proxy.ini b/docker/uwsgi.ts_proxy.ini deleted file mode 100644 index f73b0dae..00000000 --- a/docker/uwsgi.ts_proxy.ini +++ /dev/null @@ -1,42 +0,0 @@ -[uwsgi] -# Base configuration -chdir = /app -virtualenv = /dispatcharrpy -env = DJANGO_SETTINGS_MODULE=dispatcharr.settings - -# TS Proxy specific - SINGLE PROCESS with async handling -master = true -module = dispatcharr.wsgi:application -processes = 1 -workers = 1 -threads = 2 -enable-threads = true - -# Add these async settings to handle many more connections -gevent = 100 -async = 100 -ugreen = true - -# Listen on a dedicated port -http = 0.0.0.0:5657 -http-keepalive = 1 - -# Optimize for streaming -http-timeout = 3600 # 1 hour streaming timeout -socket-timeout = 3600 -harakiri = 3600 -buffer-size = 262144 # 256KB buffer -post-buffering = 0 # Disable post buffering for streams -thunder-lock = true # Process lock for better stability -so-keepalive = true # Enable TCP keepalive - -# Prevent auto-restart during streaming -max-requests = 0 # Don't restart after X requests -worker-reload-mercy = 30 -ignore-sigpipe = true -ignore-write-errors = true -disable-write-exception = true - -# Route handling - only handle proxy routes -route = ^/proxy/ continue: -route = .* break:404 \ No newline at end of file