The runtime section specifies configuration settings for the Spice runtime.
runtime.authruntime.auth.api-keySpice supports adding optional authentication to its API endpoints via configurable API keys. Learn more.
API key authentication supports the following configuration parameters:
| Parameter name | Optional | Default | Description |
|---|---|---|---|
enabled | Yes | false | Defaults to false. Whether API key authentication is enabled |
keys | Yes | [] | A list of API keys used to authenticate requests. |
runtime.dataset_load_parallelismThis setting specifies the maximum number of datasets that can be loaded in parallel during startup. By default, the number of parallel datasets is unlimited.
runtime.cachingThis setting specifies cache settings for supported Runtime components:
sql_results: Specifies cache settings for results from SQL queries.search_results: Specifies cache settings for results from searches.embeddings: Specifies cache settings for embeddings requests.Runtime caches support common configuration parameters:
| Parameter name | Optional | Default | Description |
|---|---|---|---|
enabled | Yes | true | Defaults to true. |
max_size | Yes | 128MiB | Maximum cache size. Defaults to 128MiB. |
eviction_policy | Yes | lru | Cache replacement policy when the cache reaches max_size. Defaults to lru. Supports lru (Least Recently Used) and tiny_lfu (Tiny Least Frequently Used, higher hit rate for skewed access patterns). |
item_ttl | Yes | 1s | Cache entry expiration duration (Time to Live). Defaults to 1 second. |
hashing_algorithm |
runtime.caching.search_resultsThe search results cache section specifies runtime search cache configuration. Learn more.
The search results cache supports the common cache configuration parameters.
runtime.caching.embeddingsThe embeddings cache section specifies runtime embeddings requests cache configuration. Learn more.
The embeddings cache supports the common cache configuration parameters.
runtime.caching.sql_resultsThe SQL results cache section specifies runtime SQL query cache configuration. Learn more.
In addition to the common cache configuration parameters, sql_results also supports the following parameters:
| Parameter name | Optional | Default | Description |
|---|---|---|---|
cache_key_type | Yes | plan | Determines how cache keys are generated. Defaults to plan. plan uses the query's logical plan, while sql uses the raw SQL query string. |
encoding | Yes | none | Compression algorithm for cached results. Defaults to none. Supports none or zstd. |
stale_while_revalidate_ttl | Yes | 0s | Duration to serve stale cache entries while revalidating in the background. When set to a non-zero value, expired cache entries continue to be served while a background refresh occurs. Defaults to 0s (disabled). |
:::info
runtime.results_cache has been deprecated and will be removed in a future release. If runtime.results_cache is specifed in the spicepod it will override the runtime.caching.sql_results settings if it is not defined.
:::
cache_key_typeplan (Default): Uses the query's logical plan as the cache key. Matches semantically equivalent queries but requires query parsing.sql: Uses the raw SQL string as the cache key. Provides faster lookups but requires exact string matches. Queries with dynamic functions, such as NOW(), may produce unexpected results. Use sql only when results are predictable.Use sql for the lowest latency with identical queries that do not include dynamic functions. Use plan for greater flexibility.
hashing_algorithmxxh3 (Default): Uses the XXH3 algorithm for hashing the cache keys. XXH3 is a fast, non-cryptographic hash algorithm that provides high performance and good distribution. It is suitable for scenarios where speed is critical and cryptographic security is not required.siphash: Uses the SipHash1-3 algorithm for hashing the cache keys, the default hashing algorithm of Rust. This hashing algorithm is a secure algorithm that implements verified protections against "hash flooding" denial of service (DoS) attacks. Reasonably performant, and provides a high level of security.ahash: Uses the AHash algorithm for hashing the cache keys. The AHash algorithm is a high quality hashing algorithm, and has claimed resistance against hashing DoS attacks. AHash has higher performance than SipHash1-3, especially when used with cache_key_type: plan.blake3: Uses the BLAKE3 cryptographic hash function. BLAKE3 is a fast, parallelizable hash function that provides cryptographic security while maintaining high performance. It is suitable for scenarios requiring both speed and cryptographic guarantees.xxh32, xxh64, : Variants of the XXH hashing algorithm with different output sizes. These algorithms offer a balance between speed and collision resistance, with larger hash sizes providing better collision resistance at the cost of performance.Use xxh3 (the default) for its superior speed in most scenarios. Use ahash, xxh64 or xxh128 for reduced collision probability when caching a large number of queries. Use blake3 when cryptographic security is required. Use siphash when protection against hash flooding attacks is a priority.
runtime.shutdown_timeoutControls how long Spice waits for connections to be gracefully drained and for components to shut down cleanly during runtime termination. Defaults to 30 seconds.
runtime.tlsThe TLS section specifies the configuration for enabling Transport Layer Security (TLS) for all endpoints exposed by the runtime. Learn more about enabling TLS.
In addition to configuring TLS via the manifest, TLS can also be configured via spiced command line arguments using the --tls-enabled true flag along with --tls-certificate/--tls-certificate-file and --tls-key/--tls-key-file.
runtime.tls.enabledEnables or disables TLS for the runtime endpoints.
runtime.tls.certificateThe TLS certificate to use for securing the runtime endpoints. The certificate can also come from secrets.
runtime.tls.certificate_fileThe path to the TLS PEM-encoded certificate file. Only one of certificate or certificate_file must be used.
runtime.tls.keyThe TLS key to use for securing the runtime endpoints. The key can also come from secrets.
runtime.tls.key_fileThe path to the TLS PEM-encoded key file. Only one of key or key_file must be used.
runtime.task_historyThe task history section specifies runtime task history configuration. For more details, see the Task History documentation.
| Parameter name | Optional | Description |
|---|---|---|
enabled | Yes | Defaults to true. |
captured_output | Yes | Specifies the level of output captured by the task history table. Defaults to none. |
captured_plan | Yes | Controls SQL query plan capture. Options: none (default), explain, or explain analyze. Query plans are captured asynchronously after query completion. |
min_sql_duration | Yes | Minimum query execution duration before a plan is captured. Only queries exceeding this threshold are captured. Example: 5s. |
min_plan_duration | Yes | Minimum plan execution duration before a plan is captured. This threshold applies to the execution time of the EXPLAIN operation itself. Example: 10s. |
retention_period |
runtime.corsThe CORS section specifies the configuration for enabling Cross-Origin Resource Sharing (CORS) for the HTTP endpoint. By default, CORS is disabled.
Default configuration:
runtime.cors.enabledEnables or disables CORS for the HTTP endpoint. Defaults to false.
runtime.cors.allowed_originsA list of allowed origins for CORS requests. Defaults to ["*"], which permits all origins.
Example:
This configuration permits requests only from the https://example.com origin.
runtime.query.memory_limitThe memory_limit parameter sets a memory usage cap for the Spice runtime query engine. This limit applies only to the query engine and should be used in addition to other memory configuration options, such as duckdb_memory_limit. When memory_limit is specified, the value of runtime.query.temp_directory determines the directory DataFusion uses for spilling intermediate data to disk.
Specify the value as a size, for example 4GiB or 1024MiB.
For detailed memory information, see Memory.
runtime.query.spill_compressionThe spill_compression parameter configures compression for spill files generated during large query execution in the Spice runtime.
Supported values:
zstd (default): Enables high compression ratios for spill files, reducing disk usage but with moderate (de)compression speed.lz4_frame: Provides faster (de)compression, resulting in larger spill files and potentially higher disk usage.uncompressed: Disables compression. Spill files will be the largest, but with no (de)compression overhead.This setting controls the trade-off between disk space usage and query performance for large-scale analytics workloads.
runtime.query.temp_directoryThe path to a temporary directory that Spice uses for query and acceleration operations that spill to disk. For more details, see the Managing Memory Usage documentation and the DuckDB Data Accelerator documentation.
runtime.output_levelControls verbosity in addition to the existing CLI and environment variable support..
Supported values are info, verbose, and very_verbose. The value is applied in the following priority: CLI, environment variables, then YAML configuration.
runtime.telemetryThe telemetry section configures runtime telemetry collection and export. Learn more.
runtime.telemetry.enabledEnables or disables runtime telemetry collection. Defaults to true.
runtime.telemetry.otel_exporterConfigures an OpenTelemetry metrics exporter to push metrics to an OpenTelemetry collector. The exporter automatically infers the protocol (gRPC or HTTP) based on the endpoint configuration.
| Parameter name | Optional | Default | Description |
|---|---|---|---|
enabled | Yes | true | Whether the OpenTelemetry exporter is enabled. |
endpoint | No | - | The OpenTelemetry collector endpoint. Protocol is inferred from the format (see examples below). |
push_interval | Yes | 60s | How frequently metrics are pushed to the collector. Specify as a duration. |
metrics | Yes | [] | List of metric names to export. When empty (default), all metrics are exported. |
Protocol inference:
localhost:4317). gRPC uses port 4317 by default.http:// or https:// scheme and the /v1/metrics path (e.g., http://localhost:4318/v1/metrics). HTTP uses port 4318 by default.Examples:
gRPC configuration:
HTTP configuration:
With metric filtering (export only specific metrics):
runtime.metricsSpecifies metrics that are disabled by default.
Following metrics are disabled by default:
dataset_acceleration_max_timestamp_before_refresh_msdataset_acceleration_max_timestamp_after_refresh_msdataset_acceleration_refresh_lag_msdataset_acceleration_ingestion_lag_msFor details about these metrics, see Observability.
runtime.flightConfigures Arrow Flight protocol settings for the runtime.
| Parameter name | Optional | Default | Description |
|---|---|---|---|
max_message_size | Yes | - | Maximum size of a single Arrow Flight message. |
do_put_rate_limit_enabled | Yes | true | Whether rate limiting is applied to DoPut Arrow Flight operations. |
runtime.ready_stateControls when the runtime readiness probe (/v1/ready) reports the runtime as ready. This is particularly useful for Kubernetes readiness probes.
| Value | Description |
|---|---|
on_load (default) | The runtime reports ready after all components (datasets, models, etc.) have loaded successfully. |
on_registration | The runtime reports ready as soon as all components have been registered, before they finish loading. |
runtime.schedulerConfigures the cluster scheduler when running Spice in cluster mode. This section is relevant only when using --role scheduler.
| Parameter name | Optional | Default | Description |
|---|---|---|---|
state_location | No | - | Root URI for shared cluster state storage (e.g. s3://bucket/path/). |
params | Yes | - | Object store parameters (e.g. aws_region). |
partition_management.interval | Yes | 30s | How often the scheduler runs partition assignment cycles. |
partition_management.max_assignments_per_cycle | Yes | 100 | Maximum number of partition assignments per cycle. |
partition_management.max_partitions_per_executor | Yes | 1000 | Maximum number of partitions assigned to a single executor. |
partition_management.discovery_timeout | Yes | 60s | How long the scheduler waits for executor discovery before timing out. |
| Yes |
xxh3 |
Selects which hashing algorithm is used to hash the cache keys when storing the results. Defaults to xxh3. Supports xxh3, ahash, siphash, blake3, xxh32, xxh64, or xxh128. |
xxh128| Yes |
Specifies how long records in the task history table are retained. Defaults to 8h (8 hours). |
retention_check_interval | Yes | Specifies how often old records are checked for removal. Defaults to 15m (15 minutes). |