Skip to content

Configuration

Aperio can be tuned via an optional TOML config file. Set the CONFIG_FILE environment variable to point to your config file. If unset or missing, safe defaults are used.

Example

Place a config.toml file and mount it into the container:

sh
docker run \
  -v $(pwd)/config.toml:/data/config.toml \
  -e DATA_DIR=/data \
  -e CONFIG_FILE=/data/config.toml \
  -p 3000:3000 \
  andresribeiro/aperio

Example config.toml:

toml
min_token_length = 2
max_shard_size = 1000
max_roaring_shard_size = 100000
block_cache_size = 536870912       # 512 MiB
write_buffer_size = 67108864       # 64 MiB
maintenance_threads = 4
compression = "lz4"
block_size = 65536                 # 64 KiB
log_level = "info"                 # trace, debug, info, warn, error
index_interval_ms = 900            # ms between index queue flushes
max_queue_batch_size = 1000        # items processed per background tick
main_api_key = "my-secret-key"     # main API key (full access)
search_api_key = "my-search-key"   # search-only API key (search & suggest only)
dumps_folder = "/data/dumps"       # backup snapshot directory

Configuration Reference

FieldTypeDefaultDescription
min_token_lengthinteger2Minimum length of indexed tokens — shorter tokens are discarded during indexing
max_shard_sizeinteger1000Max document IDs per string posting-list shard
max_roaring_shard_sizeinteger100000Max document IDs per roaring bitmap shard (only applies to number collections)
block_cache_sizeinteger (bytes)33554432 (32 MiB)fjall LSM block cache capacity. Recommended ~20-25% of available memory
write_buffer_sizeinteger (bytes)67108864 (64 MiB, fjall default)Per-keyspace memtable (write buffer) size. Larger values reduce write amplification at the cost of memory
maintenance_threadsintegermin(# CPUs, 4)Number of background worker threads for compaction, flush, and journal maintenance
compressionstring"none" (fjall default)Data block compression algorithm: "none" or "lz4"
block_sizeinteger (bytes)4096 (4 KiB, fjall default)Data block size. Larger values (e.g. 64 KiB) improve range-scan throughput; smaller values reduce read amplification for point lookups
log_levelstring"info"Log level: "trace", "debug", "info", "warn", or "error". Overridden by the RUST_LOG environment variable if set
index_interval_msinteger900Interval in milliseconds between background index queue flushes. Lower values reduce write-to-search latency; higher values batch more work per flush
max_queue_batch_sizeinteger1000Maximum items to pull from the index queue per background tick. Lower values reduce per-tick memory usage during bulk ingestion; higher values drain the queue faster
main_api_keystringSecretApiKeyMain API key with full access to all endpoints. Overridden by the MAIN_API_KEY environment variable if set
search_api_keystringPublicApiKeySearch-only API key for search and suggest endpoints. Overridden by the SEARCH_API_KEY environment variable if set
dumps_folderstring(unset)Directory where backup snapshots are written to and read from. If not set, /backup/export and /backup/import return a 400 error. Must be an absolute or relative path writable by the server process