diff --git a/config/runtime.exs b/config/runtime.exs index 27f4b13..f95a858 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -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