From 6785079fea74380dea6be1f557e2b3f729fbb9e3 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Wed, 10 Jan 2024 15:35:29 -0700 Subject: [PATCH] adjust gunicorn logging and fix service --- other/local-llm-server.service | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/other/local-llm-server.service b/other/local-llm-server.service index 99311be..ada1dea 100644 --- a/other/local-llm-server.service +++ b/other/local-llm-server.service @@ -8,9 +8,13 @@ Requires=local-llm-daemon.service User=server Group=server WorkingDirectory=/srv/server/local-llm-server -# Need a lot of workers since we have long-running requests -# Takes about 3.5G memory -ExecStart=/srv/server/local-llm-server/venv/bin/gunicorn --workers 20 --bind 0.0.0.0:5000 server:app --timeout 60 --worker-class gevent + +# Sometimes the old processes aren't terminated when the service is restarted. +ExecStartPre=/usr/bin/pkill -9 -f "/srv/server/local-llm-server/venv/bin/python3 /srv/server/local-llm-server/venv/bin/gunicorn" + +# Need a lot of workers since we have long-running requests. This takes about 3.5G memory. +ExecStart=/srv/server/local-llm-server/venv/bin/gunicorn --workers 20 --bind 0.0.0.0:5000 server:app --timeout 60 --worker-class gevent --access-logfile '-' --error-logfile '-' + Restart=always RestartSec=2 SyslogIdentifier=local-llm-server