Skip to main content

ServerConfig

Struct ServerConfig 

Source
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: Backend

Which engine to run. Must match the binary’s compile-time feature.

§listen: IpAddr

Listen address. Defaults to loopback (127.0.0.1) — explicitly opt in to 0.0.0.0 if you want to expose the port.

§port: u16

TCP port.

§workers: Option<usize>

Number of actix worker threads. None (= unset) → one per CPU.

§prefix: String

Optional 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: bool

Negotiate 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: usize

Maximum 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: u64

Maximum rows returned by a single /query page. Larger page_size values are clamped before the backend runs. Default 100_000.

§force_lazy_above_mb: u64

When > 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: u64

Per-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: u64

Grace 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: QuackConfig

Optional DuckDB Quack remote SQL server. Only used by the DuckDB backend; ignored by DataFusion.

Trait Implementations§

Source§

impl Debug for ServerConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ServerConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ServerConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more