4 ms·
But each SQLite connection (even to the same DB) will also consume 2 FDs for the DB and the WAL. You'll more easily pool connections to the same DB, of course,
by ncruces 2y ago
But each SQLite connection (even to the same DB) will also consume 2 FDs for the DB and the WAL.
You'll more easily pool connections to the same DB, of course, but the difference might not be so stark.
- julik 2y agoSomething like that, yes. A tenant that hasn't been opened yet - well, you create the tenant first, and then proceed "as normal". With ActiveRecord, your `pool:` configuration defines how many database handles you want to keep open at the same time. I set it relatively high but it can be tweaked, I'd say. And there is automatic eviction from the pool, so if you have a few sites which are popular and a lot of sites which are not popular - it should balance out. There could be merit to "open and close right after" though, for sure.