Skip to main content
Sourcebot runs as a single container (vertical scaling). This guide helps you choose the right CPU, memory, and disk allocation based on the number of repositories you plan to index.
These recommendations are based on real-world deployments. Your results may vary depending on repository sizes, search patterns, and whether you use features like multi-branch indexing or Ask Sourcebot.

Recommendations

SmallMediumLargeExtra Large
ReposUp to 100100 – 500500 – 2,0002,000+
CPU2 cores4 cores8 cores16+ cores
Memory4 GB8 GB32 GB64+ GB
Disk50 GB100 GB250 GB500+ GB
We recommend using external managed Postgres and Redis instances rather than the ones embedded in the Sourcebot container, as this adds stability to your deployment. You can configure these with the DATABASE_URL and REDIS_URL environment variables. Of all resources, memory has the most direct impact on search performance. Sourcebot uses Zoekt for search indexing, and the OS page cache keeps frequently accessed index data in memory. More memory means more of the index stays cached, which translates directly to faster searches and less disk I/O.

Disk usage

Disk is consumed by two things:
  1. Cloned repositories stored in the .sourcebot/ cache directory
  2. Zoekt search indexes built from those repositories
As a rule of thumb, plan for 2 – 3x the total size of the source code you intend to index. For example, if your repositories total 50 GB, allocate at least 100 – 150 GB of disk.
Multi-branch indexing significantly increases disk usage since each indexed branch produces its own search index. In testing, enabling branch indexing across all branches can triple storage requirements. Start with a subset of branches (e.g., release branches) and monitor disk usage before expanding.

Tuning concurrency

If your instance is resource-constrained, you can reduce the concurrency of background jobs to lower CPU and memory pressure during indexing. These are configured in your config file:
SettingDefaultDescription
maxRepoIndexingJobConcurrency8Number of repos indexed in parallel
maxConnectionSyncJobConcurrency8Number of connections synced in parallel
Lowering these values reduces peak resource usage at the cost of slower initial indexing.

Monitoring

We recommend monitoring the following metrics after deployment to validate your sizing:
  • Memory utilization: sustained usage near the limit suggests you should scale up memory. High memory usage is expected and healthy since the OS page cache will use available memory.
  • CPU utilization: sustained high CPU during searches (not just during indexing) indicates you may need more cores.
  • Disk usage: monitor disk consumption as you add repositories. Running out of disk will cause indexing failures.
  • Search response times: if searches are consistently slow, try increasing memory first, then CPU.