diff options
| author | noirscape <neko@catgirlsin.space> | 2022-02-12 22:16:13 +0100 |
|---|---|---|
| committer | Shyam Sunder <sgsunder1@gmail.com> | 2022-02-14 17:33:23 -0500 |
| commit | 82541536afd95ebbbb72b1983caae77b67eb8b2d (patch) | |
| tree | 5bc18a029ef052797992342000bf1cfe61935ec3 /server/docker-start.sh | |
| parent | 6de0a742570058365753266d6b8f43b354de9b11 (diff) | |
Make waitress thread count configurable.
This should fix most scaling problems without needing to start
more server instances. By default, waitress maintains at most
4 threads. This works fine if the database is small (sub 100k posts)
but causes a large Task queue depth to occur if the database is larger.
Letting users increase the amount of threads means that one server instance
is able to handle more requests without locking up the rest of the site.
This adds a new environment variable to .env, THREADS, which can be used to
configure the amount of threads to start and is by default set to 4
(the default amount used by waitress).
Diffstat (limited to 'server/docker-start.sh')
| -rwxr-xr-x | server/docker-start.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/docker-start.sh b/server/docker-start.sh index 34a0e49..eebef1c 100755 --- a/server/docker-start.sh +++ b/server/docker-start.sh @@ -4,5 +4,5 @@ cd /opt/app alembic upgrade head -echo "Starting szurubooru API on port ${PORT}" -exec waitress-serve-3 --port ${PORT} szurubooru.facade:app +echo "Starting szurubooru API on port ${PORT} - Running on ${THREADS} threads" +exec waitress-serve-3 --port ${PORT} --threads ${THREADS} szurubooru.facade:app |