Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ else
--worker-class ${SERVER_WORKER_CLASS:-geventwebsocket.gunicorn.workers.GeventWebSocketWorker} \
--worker-connections ${SERVER_WORKER_CONNECTIONS:-10} \
--timeout ${GUNICORN_TIMEOUT:-200} \
--keep-alive ${GUNICORN_KEEP_ALIVE:-10} \
app:socketio_app
fi
fi
4 changes: 4 additions & 0 deletions docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ API_WEBSOCKET_WORKER_CLASS=geventwebsocket.gunicorn.workers.GeventWebSocketWorke
API_WEBSOCKET_WORKER_CONNECTIONS=1000
API_WEBSOCKET_GUNICORN_TIMEOUT=360
GUNICORN_TIMEOUT=360
# Must stay above the idle connection reuse window of the HTTP clients that
# pool connections to the API (Node's undici reuses a socket for 4s). 0
# disables keep-alive.
GUNICORN_KEEP_ALIVE=10
CELERY_WORKER_CLASS=
CELERY_WORKER_AMOUNT=4
CELERY_AUTO_SCALE=false
Expand Down
6 changes: 6 additions & 0 deletions docker/envs/core-services/shared.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,12 @@ TENCENT_VECTOR_DB_DATABASE=dify
BAIDU_VECTOR_DB_DATABASE=dify
EXPOSE_PLUGIN_DAEMON_PORT=5002
GUNICORN_TIMEOUT=360
# Must stay above the idle connection reuse window of the HTTP clients that
# pool connections to this server. Node's global fetch (undici) keeps a socket
# idle for 4s before dropping it, so a shorter value here lets the server close
# a connection the client still considers reusable, which surfaces as
# intermittent ECONNRESET on server-side rendering. 0 disables keep-alive.
GUNICORN_KEEP_ALIVE=10
CELERY_WORKER_AMOUNT=
CELERY_AUTO_SCALE=false
CELERY_MAX_WORKERS=
Expand Down