Skip to Content
Client Configuration

Client Configuration

This document describes the configuration options for the Spiral client.

Configuration can be set via:

  • File: ~/.spiral.toml
  • Environment variables: Prefixed with SPIRAL__ (double underscore)
  • Runtime overrides: Override values when initializing the client, using the dot notation

Caching

Spiral supports three independent caches for different file types:

  • keys_cache: Caches key space files. Recommended to enable for workloads with repeated key lookups.
  • manifests_cache: Caches manifest files. Recommended to enable for better query planning performance.
  • fragments_cache: Caches fragment (data) files. Not recommended to enable in most cases as fragments are typically very large and benefit less from caching.

Each cache can be independently configured with separate memory limits, disk capacity, and storage paths.

Top level

Main configuration for the Spiral client, that can affect many different parts of the client.

FieldDefaultEnvironment VariableDescription
file_formatvortexSPIRAL__FILE_FORMATFile format for table storage
devfalseSPIRAL__DEVDevelopment mode flag

Authn

Authentication related settings

FieldDefaultEnvironment VariableDescription
authn.device_codefalseSPIRAL__AUTHN__DEVICE_CODEWhether to force device code authentication flow. This exist as an override when e.g. ssh-ing into an environment machine.
authn.token-SPIRAL__AUTHN__TOKENOptional authentication token.

Fragments Cache

Client cache limits and constraints

FieldDefaultEnvironment VariableDescription
fragments_cache.enabledfalseSPIRAL__FRAGMENTS_CACHE__ENABLEDCache is currently disabled by default.
fragments_cache.memory_capacity_bytes2 * (1 << 30)SPIRAL__FRAGMENTS_CACHE__MEMORY_CAPACITY_BYTESMemory cache size in bytes.
fragments_cache.disk_capacity_bytes20 * (1 << 30)SPIRAL__FRAGMENTS_CACHE__DISK_CAPACITY_BYTESDisk cache size in bytes.
fragments_cache.disk_pathspiralSPIRAL__FRAGMENTS_CACHE__DISK_PATHDisk cache path override. If not set, defaults to $XDG_CACHE_HOME/spiral or ~/.cache/spiral
fragments_cache.block_size16 * (1 << 20)SPIRAL__FRAGMENTS_CACHE__BLOCK_SIZEBlock size for the disk cache engine. This is the minimum eviction unit and also limits the maximum cacheable entry size.
fragments_cache.buffer_pool_size16 * (1 << 20)SPIRAL__FRAGMENTS_CACHE__BUFFER_POOL_SIZETotal flush buffer pool size in bytes (RAM). Each flusher gets buffer_pool_size / flushers bytes. Entries larger than this are dropped.
fragments_cache.submit_queue_size_threshold16 * (1 << 20)SPIRAL__FRAGMENTS_CACHE__SUBMIT_QUEUE_SIZE_THRESHOLDIf the total estimated size in the submit queue exceeds this threshold, further entries are silently dropped.
fragments_cache.blob_index_size4 * (1 << 10)SPIRAL__FRAGMENTS_CACHE__BLOB_INDEX_SIZESize of the blob index for each blob on disk. A larger index can hold more entries per blob but increases per-blob I/O.
fragments_cache.write_on_insertion-SPIRAL__FRAGMENTS_CACHE__WRITE_ON_INSERTIONWhen true, entries are written to disk immediately on insertion. When false, entries are only written to disk when evicted from memory.

Keys Cache

Client cache limits and constraints

FieldDefaultEnvironment VariableDescription
keys_cache.enabledfalseSPIRAL__KEYS_CACHE__ENABLEDCache is currently disabled by default.
keys_cache.memory_capacity_bytes2 * (1 << 30)SPIRAL__KEYS_CACHE__MEMORY_CAPACITY_BYTESMemory cache size in bytes.
keys_cache.disk_capacity_bytes20 * (1 << 30)SPIRAL__KEYS_CACHE__DISK_CAPACITY_BYTESDisk cache size in bytes.
keys_cache.disk_pathspiralSPIRAL__KEYS_CACHE__DISK_PATHDisk cache path override. If not set, defaults to $XDG_CACHE_HOME/spiral or ~/.cache/spiral
keys_cache.block_size16 * (1 << 20)SPIRAL__KEYS_CACHE__BLOCK_SIZEBlock size for the disk cache engine. This is the minimum eviction unit and also limits the maximum cacheable entry size.
keys_cache.buffer_pool_size16 * (1 << 20)SPIRAL__KEYS_CACHE__BUFFER_POOL_SIZETotal flush buffer pool size in bytes (RAM). Each flusher gets buffer_pool_size / flushers bytes. Entries larger than this are dropped.
keys_cache.submit_queue_size_threshold16 * (1 << 20)SPIRAL__KEYS_CACHE__SUBMIT_QUEUE_SIZE_THRESHOLDIf the total estimated size in the submit queue exceeds this threshold, further entries are silently dropped.
keys_cache.blob_index_size4 * (1 << 10)SPIRAL__KEYS_CACHE__BLOB_INDEX_SIZESize of the blob index for each blob on disk. A larger index can hold more entries per blob but increases per-blob I/O.
keys_cache.write_on_insertion-SPIRAL__KEYS_CACHE__WRITE_ON_INSERTIONWhen true, entries are written to disk immediately on insertion. When false, entries are only written to disk when evicted from memory.

Limits

Client resource limits and constraints

FieldDefaultEnvironment VariableDescription
limits.batch_readaheadNonZeroUsize :: new (min (num_cpus :: get ()SPIRAL__LIMITS__BATCH_READAHEADMaximum number of concurrent shards to evaluate, “read ahead”, when scanning. Defaults to min(number of CPU cores, 32).
limits.transaction_retries3SPIRAL__LIMITS__TRANSACTION_RETRIESMaximum number of transaction retries on conflict before giving up.
limits.transaction_manifest_max_rows-SPIRAL__LIMITS__TRANSACTION_MANIFEST_MAX_ROWSMaximum number of rows in manifest when compacting transaction.
limits.transaction_compact_threshold100SPIRAL__LIMITS__TRANSACTION_COMPACT_THRESHOLDAutomatically compact transaction operations before commit if operation count exceeds this threshold. Set to 0 to disable auto-compaction.
limits.key_space_max_rows100_000_000SPIRAL__LIMITS__KEY_SPACE_MAX_ROWSMaximum number of rows in a key space. Compaction keeps fragments across column groups aligned to L1 key spaces. When this limit is larger, the L1 key spaces might change more frequently, causing a re-alignment to happen. When this limit is smaller, more fragments may have to be split due to key space boundaries.
limits.http_max_retries10SPIRAL__LIMITS__HTTP_MAX_RETRIESMaximum number of HTTP request retries on transient errors.
limits.http_min_retry_interval_ms100SPIRAL__LIMITS__HTTP_MIN_RETRY_INTERVAL_MSMinimum number of milliseconds to wait between HTTP request retries.
limits.http_max_retry_interval_ms5 * 60 * 1000SPIRAL__LIMITS__HTTP_MAX_RETRY_INTERVAL_MSMaximum number of milliseconds to wait between HTTP request retries.
limits.write_buffer_max_bytes1024 * 1024 * 1024SPIRAL__LIMITS__WRITE_BUFFER_MAX_BYTESMaximum number of bytes to buffer in memory when writing key table batches.
limits.write_partition_max_bytes128 * 1024 * 1024SPIRAL__LIMITS__WRITE_PARTITION_MAX_BYTESMaximum number of bytes in an uncompressed fragment file.
limits.scan_eval_concurrency4SPIRAL__LIMITS__SCAN_EVAL_CONCURRENCYMaximum number of concurrent scan node evaluations (fragment processing) during scans.
limits.compaction_task_concurrency1SPIRAL__LIMITS__COMPACTION_TASK_CONCURRENCYMaximum number of concurrent tasks in compaction.
limits.manifest_read_concurrency2 * num_cpus :: get ()SPIRAL__LIMITS__MANIFEST_READ_CONCURRENCYMaximum number of concurrent manifest file reads.
limits.manifest_write_concurrency2 * num_cpus :: get ()SPIRAL__LIMITS__MANIFEST_WRITE_CONCURRENCYMaximum number of concurrent manifest file writes.
limits.fragment_cache_bytes256 * 1024 * 1024SPIRAL__LIMITS__FRAGMENT_CACHE_BYTESMaximum in-memory footprint (in bytes) of the fragment cache.
limits.compaction_split_compressed_max_bytes1024 * 1024 * 1024SPIRAL__LIMITS__COMPACTION_SPLIT_COMPRESSED_MAX_BYTESMaximum total compressed size of fragments accumulated in a single compaction split.
limits.compaction_size_based_threshold_bytes8 * 1024 * 1024SPIRAL__LIMITS__COMPACTION_SIZE_BASED_THRESHOLD_BYTESFragments smaller than this threshold will be considered for compaction when size-based compaction strategy is used.
limits.join_set_concurrencynum_cpus :: get ()SPIRAL__LIMITS__JOIN_SET_CONCURRENCYMaximum number of concurrent tasks in a JoinSet. Defaults to the number of CPU cores.
limits.object_storage_client_pool_max_idle_per_hostNoneSPIRAL__LIMITS__OBJECT_STORAGE_CLIENT_POOL_MAX_IDLE_PER_HOSTpool_max_idle_per_host for object storage clients.
limits.object_storage_client_pool_idle_timeout_sNoneSPIRAL__LIMITS__OBJECT_STORAGE_CLIENT_POOL_IDLE_TIMEOUT_Spool_idle_timeout for object storage clients.
limits.read_max_iops_per_file-SPIRAL__LIMITS__READ_MAX_IOPS_PER_FILEMaximum number of concurrent HTTP requests when reading a single file. This is an upper bound on the number of concurrent I/O requests to a single VortexReadAt instance. Usually only one of these exists per Vortex file, so this is a rough upper limit on the number of concurrent requsts to each fragment or manifest file. See also: [read_thread_per_core_per_file].
limits.read_threads_per_core_per_file1SPIRAL__LIMITS__READ_THREADS_PER_CORE_PER_FILEThe number of read threads per core per file. See also: [read_max_iops_per_file], which is a limit shared across all cores and threads reading from the same file object.
limits.io_merge_threshold1024 * 1024SPIRAL__LIMITS__IO_MERGE_THRESHOLDByte range merge distance threshold (in bytes) for IO coalescing. Nearby byte ranges within this distance are merged into single HTTP requests.
limits.spfs_max_retries3SPIRAL__LIMITS__SPFS_MAX_RETRIESMaximum number of SPFS operation retries on transient errors. A single SPFS read operation may comprise tens or hundreds of distinct HTTP requests. SPFS write operations may comprise multiple HTTP requests but are typically just one (long) HTTP request.

Manifests Cache

Client cache limits and constraints

FieldDefaultEnvironment VariableDescription
manifests_cache.enabledfalseSPIRAL__MANIFESTS_CACHE__ENABLEDCache is currently disabled by default.
manifests_cache.memory_capacity_bytes2 * (1 << 30)SPIRAL__MANIFESTS_CACHE__MEMORY_CAPACITY_BYTESMemory cache size in bytes.
manifests_cache.disk_capacity_bytes20 * (1 << 30)SPIRAL__MANIFESTS_CACHE__DISK_CAPACITY_BYTESDisk cache size in bytes.
manifests_cache.disk_pathspiralSPIRAL__MANIFESTS_CACHE__DISK_PATHDisk cache path override. If not set, defaults to $XDG_CACHE_HOME/spiral or ~/.cache/spiral
manifests_cache.block_size16 * (1 << 20)SPIRAL__MANIFESTS_CACHE__BLOCK_SIZEBlock size for the disk cache engine. This is the minimum eviction unit and also limits the maximum cacheable entry size.
manifests_cache.buffer_pool_size16 * (1 << 20)SPIRAL__MANIFESTS_CACHE__BUFFER_POOL_SIZETotal flush buffer pool size in bytes (RAM). Each flusher gets buffer_pool_size / flushers bytes. Entries larger than this are dropped.
manifests_cache.submit_queue_size_threshold16 * (1 << 20)SPIRAL__MANIFESTS_CACHE__SUBMIT_QUEUE_SIZE_THRESHOLDIf the total estimated size in the submit queue exceeds this threshold, further entries are silently dropped.
manifests_cache.blob_index_size4 * (1 << 10)SPIRAL__MANIFESTS_CACHE__BLOB_INDEX_SIZESize of the blob index for each blob on disk. A larger index can hold more entries per blob but increases per-blob I/O.
manifests_cache.write_on_insertion-SPIRAL__MANIFESTS_CACHE__WRITE_ON_INSERTIONWhen true, entries are written to disk immediately on insertion. When false, entries are only written to disk when evicted from memory.

Server

API endpoint configuration for the Spiral control plane

FieldDefaultEnvironment VariableDescription
server.urlhttps://api.spiraldb.devSPIRAL__SERVER__URLThe SpiralDB API endpoint URL

Spfs

SpFS (Spiral File System) configuration

FieldDefaultEnvironment VariableDescription
spfs.urlhttps://spfs.spiraldb.devSPIRAL__SPFS__URLThe SpFS (Spiral File System) endpoint URL

Telemetry

Telemetry configuration for the Spiral client

FieldDefaultEnvironment VariableDescription
telemetry.enabledfalseSPIRAL__TELEMETRY__ENABLEDWhether client-side telemetry export is enabled.
Last updated on