pub struct ServerConfig {
pub backend: Backend,
pub listen: IpAddr,
pub port: u16,
pub workers: Option<usize>,
pub prefix: String,
pub compress: bool,
pub max_body_bytes: usize,
pub max_page_size: u64,
pub force_lazy_above_mb: u64,
pub request_timeout_ms: u64,
pub shutdown_timeout_secs: u64,
pub quack: QuackConfig,
}Fields§
§backend: BackendWhich engine to run. Must match the binary’s compile-time feature.
listen: IpAddrListen address. Defaults to loopback (127.0.0.1) — explicitly opt in to 0.0.0.0 if you want to expose the port.
port: u16TCP port.
workers: Option<usize>Number of actix worker threads. None (= unset) → one per CPU.
prefix: StringOptional URL path prefix — useful when sitting behind a reverse
proxy that rewrites e.g. /datapress/... → /.... When set, every
route is mounted under this prefix (so the proxy can pass the URL
through unchanged). Must start with / and not end with /; the
empty string (default) means no prefix.
compress: boolNegotiate response compression (gzip / brotli / zstd) via the
Accept-Encoding request header. Enabled by default. Disable when
running behind a proxy that already compresses, or when the extra
CPU is not worth the bandwidth saving.
max_body_bytes: usizeMaximum accepted JSON request body size, in bytes. Larger bodies
are rejected with 413 Payload Too Large before any handler runs.
Default 1 MiB. Most query bodies are well under 10 KiB; this is
a DoS guard, not a tuning knob.
max_page_size: u64Maximum rows returned by a single /query page. Larger
page_size values are clamped before the backend runs.
Default 100_000.
force_lazy_above_mb: u64When > 0, any dataset whose backing files exceed this many
megabytes is forced into lazy mode at startup (streamed from
disk instead of materialised into RAM), even if lazy was not set
on the dataset. 0 (default) disables the size check. Local
sources are sized with a filesystem stat; on the DataFusion backend
S3 sources are sized by listing the object store under their prefix
(the DuckDB backend only sizes local sources — S3 datasets there
must opt in with an explicit lazy = true). Delta tables are
measured by summing their parquet data files.
request_timeout_ms: u64Per-request handler timeout, in milliseconds. If a handler hasn’t
produced a response within this budget the request is aborted with
504 Gateway Timeout. Default 30_000 (30 s). Set 0 to disable.
shutdown_timeout_secs: u64Grace period for in-flight requests after the server has received
SIGTERM / SIGINT, in seconds. The listening socket is closed
immediately; existing connections then have up to this many
seconds to finish before workers are force-stopped. Default 30.
quack: QuackConfigOptional DuckDB Quack remote SQL server. Only used by the DuckDB backend; ignored by DataFusion.