Help with SQLite reliability (idle time & timeout errors)

Thanks for the tips, I’d missed the shared cache thing, and the read_uncommitted PRAGMA.

I see u are using file-based db - so u don’t need them

More problematic is the most costly operation, which is cleanup

To address the issue with the long cleanup query, you could try optimizing it or splitting it into several smaller queries, and slightly increasing the timeout and pool values.

pool_size: 50,
busy_timeout: 5_000,