Skip to main content
ToraDB uses the same binaries for ingest and serving; tune behavior with environment variables. The demo applies presets via TORADB_PROFILE in demo/run.sh.

Profiles

ProfileTORADB_CACHE_*TORADB_WARMUP_ON_STARTTypical workload
ingestTORADB_CACHE_INDEX_BYTES=256MB (low)0toradb-ingest, resume, bulk load
servingTORADB_CACHE_AUTO=1 or explicit 4–8GB1API, repeated queries

Ingest

  • Keep index cache small so ingest does not compete with segment writes.
  • Disable warmup; no query path yet.
  • After bulk load, run toradb-ingest resume --db PATH --table TABLE to build TBM3 sidecars, lexicons, and optional route index.
export TORADB_PROFILE=ingest
./target/release/toradb-ingest resume --db ./data/my_table --table passages

Serving

  • Use TORADB_CACHE_AUTO=1 to size the mmap BM25 cache from available RAM (TORADB_CACHE_INDEX_FRACTION, default 0.20, capped by TORADB_CACHE_AUTO_CAP_BYTES, default 8GB).
  • Override with TORADB_CACHE_INDEX_BYTES when you need a fixed budget.
  • Enable TORADB_WARMUP_ON_START=1 for APIs so the first user query is not cold.
export TORADB_PROFILE=serving
export TORADB_CACHE_AUTO=1
TORADB_DEBUG=1 ./demo/run.sh

Cache variables

VariableDefaultPurpose
TORADB_CACHE_INDEX_BYTES256MBFixed LRU budget for segment BM25 mmap blobs
TORADB_CACHE_AUTOoffSet 1 to derive index_bytes from system RAM
TORADB_CACHE_INDEX_FRACTION0.20Fraction of RAM for auto budget
TORADB_CACHE_AUTO_CAP_BYTES8GBUpper cap for auto budget
TORADB_CACHE_DEBUGoffLog chosen cache budget at startup
See also Search strategies and On-disk layout.