mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-28 12:36:42 +00:00
Switched to using main uwsgi for proxy.
This commit is contained in:
parent
ed30b8608d
commit
a275ac8530
3 changed files with 1 additions and 55 deletions
|
|
@ -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..."
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue