Capacity Planning for Multi-Tenant SQLite Applications

18-Oct-2025 452
Capacity planning is hard when you have multiple users with SQLite databases, users are pinned to specific machines, and there are hard memory limits. As the number of users grows and regions are consolidated, I need to reconsider my capacity planning strategy. Here's the topology of my showcase application: Each user is a dance studio, and each dance studio has multiple events (past, current, and future). Each event is a separate tenant with its own database and its own instance of the same Rails application. All tenants for a given user are on the same machine. Multiple users (and their tenants) are assigned to the same machine. Currently, I have 70+ users distributed across 8 machines. At the moment, sjc and iad are the most concentrated regions. Puma is configured to three threads per tenant. Individual tenants (Rails applications) are shut down after five minutes of idle. Machines suspend at thirty minutes of idle. All machines are provisioned with 2GB of RAM and bad things happen (OOM kills, performance degradation) when that limit is reached. The concern is that with multiple tenants on a single machine, memory will run out.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle