Hashing 1.96 GiB of real ROM files is 2.2x faster at 4 concurrent
workers than at 1 (108 -> 240 MiB/s on 16 cores, 108 -> 264 MiB/s
pinned to 4 cores). Pinned to 2 cores it is still 1.6x, so the new
default costs nothing on small hosts.
Metadata providers cap themselves independently of this value, so the
extra workers queue rather than exceed an allowance: ScreenScraper holds
a concurrency limiter set to the account's advertised thread count, and
the other adapters pace their own request rate. Database work in the
scan path is synchronous on the event loop, so it serializes regardless
and the connection pool is unaffected.
The compose example advised one worker per CPU, which overshoots on a
large host. Both it and env.template now say what raising this actually
buys, since metadata is paced no matter how many workers there are.
Only installs that never set SCAN_WORKERS move; any explicit value is
preserved.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
"2 x CPU cores + 1" is gunicorn's guidance for sync workers. RomM runs
UvicornWorker with sync endpoints served from Starlette's threadpool, so
the rule does not transfer: on a 16-core host it measured 3x slower than
4 workers and cost 5.31 GB PSS.
The variable also only reaches the gunicorn API server; background tasks
run in the separate RQ worker processes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit adds a healthcheck configuration to the MariaDB service in the
Docker Compose example configuration. The healthcheck script is a simple
shell script that checks if the MariaDB server is ready to accept connections.
The application will wait for the MariaDB service to be healthy before
starting the application service. This should solve issues where the
database takes longer to start than the application, and logs some
`Something went horribly wrong with our database` errors.
This change also stops recommending the `linuxserver/mariadb` image as
an alternative. We have had users that change the image because of the
first time run triggering those errors, but the `linuxserver/mariadb`
image requires a different configuration that could be confusing for new
users (e.g. volume mountpoint needs to be `/config` instead of
`/var/lib/mysql`).
"mariadb:latest" can cause problems when mounting the database. The use of "linuxserver/mariadb:latest" may fix this issue. Added it as an alternative option.