increase sqlite busy_timeout and reduce image queue concurrency
All checks were successful
deploy / deploy (push) Successful in 1m16s

Bumps busy_timeout from 5s to 15s so Oban's internal writes can
wait out CPU-heavy libvips processing. Also drops the images queue
from 2 to 1 in prod — a single job with System.schedulers_online()
internal parallelism is enough for shared-cpu-1x and still scales
on bigger machines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey 2026-03-02 11:13:31 +00:00
parent e66d51a08b
commit 8159a312ae

View File

@ -32,7 +32,7 @@ if config_env() == :prod do
database: database_path,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "5"),
journal_mode: :wal,
busy_timeout: 5000,
busy_timeout: 15_000,
journal_size_limit: 67_108_864,
default_transaction_mode: :immediate,
custom_pragmas: [mmap_size: 134_217_728]
@ -109,6 +109,11 @@ if config_env() == :prod do
tls: :if_available
end
# On small machines (Fly shared-cpu-1x) running 2 concurrent image
# processing jobs saturates the CPU and causes SQLite locking.
# One job at a time with per-job parallelism is enough.
config :berrypod, Oban, queues: [default: 3, images: 1, sync: 1, checkout: 1, newsletter: 1]
# Stripe and Printify keys are stored encrypted in the database and loaded
# at runtime by Berrypod.Secrets. No env vars needed for those.
end