Skip to content

Spillway Configuration ​

Experimental Alpha

Spillway is an experimental alpha. Its configuration, behavior and storage formats may change in future releases.

Spillway reads one YAML file, given by --config. Inside DeltaFi's Compose stack the file is <installDirectory>/config/spillway/spillway.yaml, mounted at /config/spillway.yaml (see Deployment); in the standalone stack it is the stack's config/spillway.yaml, mounted the same way.

Spillway watches the file and its directory, and reloads it a moment after each save, including saves by editors that write a new file and rename it over the old one. A file that does not load or validate is rejected: Spillway logs configuration reload rejected; keeping the running configuration, counts it in spillway_config_reload_failures_total, and keeps running on the configuration it had. In Compose the container's health check also fails while the file is invalid, because the check loads the same file (see Config drift).

The hash of the configuration Spillway runs is exported as spillway_config_hash_info{hash}, so a configuration that differs between instances is visible. A restart-only setting the file changed is held at its running value until restart, so this hash can differ from the file's own, which is exported as spillway_config_file_hash_info{hash}; spillway_restart_required is 1 while any such setting is held.

For step-by-step setups, see the Configuration Guide.

File Format ​

  • Unknown keys are errors, so a misspelled setting is refused rather than ignored.
  • Sizes are a whole number of bytes, or a whole number with a KiB, MiB, GiB or TiB suffix: 64MiB, 10GiB.
  • Durations are Go durations: 500ms, 30s, 10m, 1h.
  • outbound.retry.backoff is written <initial>..<max>, for example 30s..1h.

Environment References ​

${NAME} anywhere in the file is replaced with the environment variable NAME before the file is parsed. A reference to a variable that is not set is an error naming it, and a $ not followed by {NAME} is kept as written.

The replacement is made in the raw text, so a value that may contain YAML-special characters such as : or # must be quoted:

yaml
instance:
  id: "${POD_NAME}"

Settings ​

Settings are global unless their path starts with channels[], which makes them per channel. Applies says when a changed value takes effect:

  • live: on the next reload;
  • restart: a reload keeps the running value, logs restart required for changed settings; they keep their running values until then naming the settings, and the new value takes effect when Spillway restarts;
  • refused: a reload that changes it is rejected, and the running configuration is kept.

Instance ​

SettingEffectDefaultApplies
instance.idStable instance identity; part of every S3 key and audit object the instance writesrequiredrefused
instance.clusterNamespaces every S3 key, so installs sharing a bucket never collide. Set it before the first start: changing it later orphans the data stored under the old valuerequiredrestart
instance.adoptAfterHeartbeat age after which a peer's S3 backlog is adopted. Adoption ships in V1, so this release accepts only the default 10m and refuses any other value10mrefused

Inbound and Admin Listeners ​

SettingEffectDefaultApplies
inbound.modeinternal: plain HTTP on DeltaFi's internal network. mtls: TLS with a client certificate required, for a standalone Spillwayinternalrestart
inbound.listenAddress the inbound listener binds:8080restart
inbound.sourceinternal mode: the source name recorded for every file (audit rows, source metric label)the value of instance.clusterlive
inbound.tls.cert, .keymtls mode: the server certificate and key, used by the inbound and the admin listener. Read once at startuprequired in mtlsrestart
inbound.tls.clientCAmtls mode: the CA bundle client certificates must chain to, for both DeltaFi senders and operatorsrequired in mtlsrestart
inbound.sourceSANsmtls mode: map from a client certificate SAN (DNS SANs first, then URI SANs) to a source namenonelive
admin.listenAddress the admin listener binds:8081restart
admin.operatorSANsmtls mode: the client certificate SANs allowed to use /admin/required in mtlslive

Metrics ​

SettingEffectDefaultApplies
metrics.pushUrlVictoriaMetrics import endpoint; Spillway pushes every 15 shttp://deltafi-victoriametrics:8428/api/v1/import/prometheusrestart

Local Storage ​

SettingEffectDefaultApplies
storage.local.pathLocal volume mountrequiredrefused
storage.local.softLimitPctLocal usage at which demotion to S3 starts50live
storage.local.hysteresisPctDemotion stops at softLimitPct − hysteresisPct; must be below softLimitPct5live
storage.local.hardLimitPctLocal usage above which arrivals that would be stored get 503 hard limit; above softLimitPct, at most 9580live
storage.local.maxBytesByte budget for Spillway's own files on a filesystem it shares; see Bounded test layoutsunset: whole-filesystem limitsrestart

Local usage is the larger of the used fraction of the volume's bytes and the used fraction of its inodes, plus reservations for files being received. Every limit compares against it. It is measured over the whole filesystem holding storage.local.path, whatever wrote to it, and blocks reserved for root count as used, so give the local volume a disk of its own (see Deployment). With storage.local.maxBytes set, local usage is instead Spillway's own bytes against that budget, and inode use is ignored; hardLimitPct also applies to the whole filesystem.

Object Store ​

SettingEffectDefaultApplies
storage.s3.endpointObject store URL, http:// or https://requiredrestart
storage.s3.bucketBucket; created at startup if missingrequiredrestart
storage.s3.credentialsFileEnv-file of AWS_ACCESS_KEY_ID=… and AWS_SECRET_ACCESS_KEY=… lines, plus an optional AWS_SESSION_TOKEN=…. Values are read as written, so they are not quoted; blank lines and # comments are ignored. The file is read again at most a minute after it changesrequiredrestart (the file's contents apply live)
storage.s3.regionSigning regionus-east-1restart

The packing and transfer settings, segmentTargetBytes and transferParallelism, are under Advanced: Packing and Transfers.

Audit ​

SettingEffectDefaultApplies
audit.retentionDaysAge of shipped audit objects (a/ in S3) the sweeper deletes90live
audit.maxLocalBytesUnshipped audit journal on the local volume above which arrivals that would be stored get 503 audit backlog; pass-through continues. 0 means the default10% of the local volume's capacitylive

Formats ​

SettingEffectDefaultApplies
formats.minWriteVersionStorage format version writers emit. This release has one format version, so it must be 1; any other value is refused1refused

Channels ​

SettingEffectDefault
channels[].idChannel id: URL path /c/<id>, S3 prefix and metric label. Lower-case letters, digits and -, not starting with -, at most 63 characters. Never change it: a new id is a new channelrequired
channels[].metadataKeyHeader holding HttpEgress's metadata JSON. Must equal the sink's metadataKeyX-DeltaFi-Metadata
channels[].dataSinkData sink name recorded for uploads that name none: DeltaFiEgress uploads, and HttpEgress and FlowFile uploads without a flowthe channel id
channels[].sourcesmtls mode: the source names (from inbound.sourceSANs) allowed to send to the channelrequired in mtls
channels[].stripHeadersHeaders stripped at ingest and never stored, in addition to Authorization, Cookie and Proxy-Authorizationnone
channels[].maxFileSizeLargest file accepted; larger files get 41310GiB
channels[].maxStreamsConcurrent inbound requests on the channel, pass-through and spill together; above it new requests get 503 stream cap. The instance accepts at most 4 × the sum over channels inbound connections32
channels[].responseBudgetLongest wait for the consumer after the body ends during a pass-through; must be below DeltaFi's 10 s response timeout, so Spillway answers DeltaFi before DeltaFi gives up. A larger value is refused at startup8s
channels[].retentionHoursUndelivered files older than this age off, with aged_off audit rows336 (14 days)
channels[].passThrough.modeauto, always, or never (every file spills)auto
channels[].passThrough.maxTimeauto: longest predicted pass-through time, consumer latency plus size ÷ bandwidth. Pass-through is the fast path for consumers answering within this time; a slower consumer is buffered50ms
channels[].passThrough.maxBytesLargest file eligible for pass-through; 0 is unlimitedunlimited
channels[].passThrough.memoryBytesFiles up to this size pass through a memory buffer, so a consumer failure still ends in a local commit and a 200; at most 16 MiB and at most maxFileSize1MiB
channels[].passThrough.bypassMaxAgeLive arrivals may bypass a backlog younger than this1h
channels[].passThrough.reservedSlotsDelivery slots backlog delivery leaves free for live arrivals; 0 disables; must be below outbound.maxConnectionsthe smaller of 2 and maxConnections − 1
channels[].passThrough.idleTimeoutOutbound idle timeout during pass-through; must be below responseBudget, which is itself below DeltaFi's 10 s. A value at or above it is refused at startup5s
channels[].passThrough.spillNextTtlHow long a DID whose large-file pass-through failed spills on resend from the same data sink; the DID from another data sink is routed as usual1h
channels[].outbound.urlConsumer endpoint: an http or https URL that names a host. Any other scheme, or a URL with no host such as https://:8443/ingest, is refusedrequired
channels[].outbound.authAt most one of clientCert: {cert, key}, basic: {user, passwordFile} or bearer: {tokenFile}, plus an optional ca bundle. The files are read at startup and again every 10 seconds, so a file replaced in place, renamed over or swapped by a Kubernetes Secret update applies within about 20 seconds, with no restart or configuration change: a change is used once two reads in a row agree. New connections use the new files; connections already open finish on the old ones. A client certificate key must be unencrypted. Files that fail to load (a missing file, a half-written certificate, a key that does not match its certificate, an encrypted key, an empty password or token file, or a CA bundle with a block that is not a whole certificate or with bytes after its last certificate) are refused at startup and rejected on a reload: Spillway logs outbound credential reload rejected; keeping the channel's running credentials with the channel, counts it in spillway_config_reload_failures_total, and keeps using the files it hadnone
channels[].outbound.maxConnectionsOutbound connection cap for the channel on this instance. The default suits only small sites; see Sizing8
channels[].outbound.adaptive.latencyTargetThe adaptive limit halves when the consumer's response latency exceeds this; at least 1ms500ms
channels[].outbound.timeouts.connect, .idle, .responseConnect timeout; idle timeout per read and write when delivering from the backlog; wait for the response after the body is sent2s, 60s, 60s
channels[].outbound.breaker.failures, .openFor, .probeEveryConsecutive consumer-scoped failures that open the breaker; how long it stays open before the first probe; time between probes5, 30s, 30s
channels[].outbound.retry.maxAttempts, .backoffFile-scoped attempts before the DLQ; retry delay range, doubling10; 30s..1h
channels[].outbound.successStatusesExtra consumer statuses treated as delivered, such as 409 from consumers that report duplicates; no 3xxnone
channels[].outbound.passThroughStatusesConsumer statuses returned to DeltaFi as they came during pass-through, and sent to the DLQ from the backlog; 4xx only400, 413, 415, 422
channels[].outbound.breakerStatusesConsumer statuses that open the breaker as a misconfiguration401, 403, 404, 405

A status may appear in only one of successStatuses, passThroughStatuses and breakerStatuses.

Every channel setting applies live. A reload that changes a channel's outbound or passThrough settings rebuilds that channel: it gets new clients, reading its credential files at once, and its adaptive limit and breaker start over. Its queue, spill-next set and, unless outbound.url changed, its latency and bandwidth estimates carry over. Other channels are untouched.

Channels Sharing a Volume ​

Channels that store files on the same local volume share it equally, with nothing to set. Each channel holding files gets the same fair share of the soft limit's demotion target, softLimitPct − hysteresisPct of the volume's capacity: at the defaults, two channels holding files get 22.5% each. Files a channel promoted from S3 and has not yet delivered count toward its share for promotion and admission, but do not count toward the excess demoted from it.

  • Demotion. Above softLimitPct, Spillway demotes paused channels and channels whose breaker is open first, oldest files first. Next it demotes each delivering channel's files beyond its share, the channel furthest over first, newest files first. Only then does it demote the newest files of every delivering channel. A channel whose consumer is slow but still accepting files gives up its own excess, so another channel's burst stays local and keeps passing through.
  • Promotion. Unless a channel's oldest files are close to aging off, or its next segment alone is softLimitPct of the volume or more, a promotion never lifts usage to softLimitPct. Between softLimitPct − hysteresisPct and softLimitPct, a channel promotes from S3 while its next segment keeps what it holds within its share, so a channel's files demoted during a burst come back while another channel holds the volume near its target. A channel that is the only one holding files keeps softLimitPct − hysteresisPct as its promotion limit, since usage also counts files no channel holds, such as other data on the filesystem. A channel over its share does not promote there, unless its oldest files are close to aging off; that promotion is still bounded by the hard limit. From softLimitPct − hysteresisPct, a segment of softLimitPct or more promotes, up to the hard limit, only while it keeps what the channel holds within its share, or into a channel holding nothing. With the defaults this share check cannot hold such a segment back, since the hard limit stops it first.
  • Admission. From hardLimitPct − hysteresisPct up to hardLimitPct (75% to 80% at the defaults), a new local-tier file from a channel over its share gets 503 fair share, which DeltaFi resends; channels under their share are admitted up to the hard limit. A channel whose backlog Spillway has not yet counted, as just after a restart, counts as over its share there. A channel is admitted up to the hard limit when no other channel holds files on the volume, since the band keeps room only for other channels.

In the fluid simulation, two channels share a 100 GB volume at the defaults while channel A's consumer runs at half its arrival rate for a day and healthy channel B bursts to ten times its rate for ten minutes at hour 12. B passes 95.9% of its files through, spills 32.6 GB and delivers every file within 1.2 hours; slow A passes 6.7% through, spills 719.3 GB with a maximum age of 18.5 hours, and gets no 503 responses.

Example ​

A channel inside DeltaFi, sending with DeltaFi's plugins certificate:

yaml
channels:
  - id: consumer-a
    metadataKey: X-DeltaFi-Metadata
    maxStreams: 32
    retentionHours: 336
    passThrough:
      mode: auto
    outbound:
      url: https://consumer-a.example/ingest
      maxConnections: 16
      auth:
        clientCert: { cert: /certs/tls.crt, key: /certs/tls.key }
        ca: /certs/ca.crt
      successStatuses: [409]

Advanced: Packing and Transfers ​

The defaults suit every documented site; change them only after a sizing run, see Sizing.

SettingEffectDefaultApplies
storage.s3.segmentTargetBytesSegment packing size; at most 1 GiB; also the most memory one salvaging promote stream holds; a file at least this size goes in a segment of its own64MiBlive, from the next demote job
storage.s3.transferParallelismConcurrent segment uploads plus promotion jobs, across all channels; one channel's demotion can use all of them. 1 to 648live

Adding and Removing Channels ​

Adding a channel to the file and saving it starts the channel at once; it never changes another channel's limits. DeltaFi sinks can then send to /c/<id>.

Removing a channel is refused, keeping the running configuration, while the channel still holds anything:

  • files on the local volume (local, retry or DLQ), or segments in S3 under this instance's prefix;
  • a backlog Spillway has not finished counting since startup, or an S3 backlog it has not finished listing;
  • a demote or promote job in progress;
  • any S3 backlog at all while the object store is unreachable, since it cannot be counted.

While a reload removes a channel, the channel's arrivals get 503 removing; a refused reload lets them in again. A channel with nothing left is removed by the reload.

Abandoning a Channel ​

To remove a channel that still holds data, start Spillway with --abandon <channel> (repeatable). Its data is then aged off with aged_off audit rows instead of delivered:

  • A channel removed by a reload. Start Spillway with --abandon <channel>, then remove the channel from the file. The reload ages off its local and S3 backlog. It is refused while the object store is unreachable or the channel's S3 backlog is still loading; retry it once the store answers.
  • A channel already missing from the file at startup. A channel that has entries under local/, retry/ or dlq/ but is not configured refuses startup, naming the channel, unless --abandon names it. With --abandon, Spillway starts and ages off the channel's local data, then, once the object store is reachable, its S3 segments. Until that ends, a reload cannot add the channel back.

So while the object store is unreachable, a reload cannot remove a channel at all; edit the file and restart with --abandon instead. Remove --abandon from the command line once the channel is gone, so that a later reload removing a channel of that name is checked again. See Orphaned channel data for setting the flag in Compose.

Open-File Budget ​

At startup, and on every reload, Spillway computes the open files its configuration needs and refuses to start, or rejects the reload, when RLIMIT_NOFILE is lower:

text
RLIMIT_NOFILE is 1024; this configuration needs at least 8654 open files (spec §6.1)

The budget is:

text
  5 × Σ maxStreams                 4 inbound connections and 1 inflight file per stream permit
+ Σ (4 × maxConnections + 2)       per channel: outbound connections and payload files, 2 directories
+ 1024 × transferParallelism       promotion staging
+ 268                              age-off workers and fixed slack

A configuration with no channels still counts 4 × 32 inbound connections. A configuration with one channel at its defaults needs 8,654, and each channel added at the defaults adds 194. No limit covers every valid configuration, since maxStreams, maxConnections and the number of channels are unbounded. The Compose service, inside DeltaFi and in the standalone stack, sets nofile to 1,048,576; to fit under a lower limit, lower transferParallelism, maxStreams or maxConnections.

Command Line ​

text
spillway --config <file> [--abandon <channel>]... [--shutdown-delay <duration>]
spillway --version
spillway health --config <file>
spillway resume-policies --action <egress action> [--method POST] [--method PUT] [--name <policy>]
Flag or commandEffect
--configThe configuration file; required
--abandon <channel>Age off the channel's data with audit rows when a reload removes it, or at startup when it is not configured (repeatable)
--shutdown-delayHow long readiness fails on shutdown before the listeners stop; default 5s. Then uploads still sending their body get 503 shutdown, and requests already committing get up to 30 s to finish
--versionPrints spillway <version> and exits
healthContainer health probe: exits 0 when the admin listener's /readyz answers 200 within 3 s, and 1 otherwise. It loads the same configuration file, and dials the configured admin.listen host, or 127.0.0.1 when that binds every interface
resume-policiesPrints the DeltaFi auto-resume policies for a Spillway-backed sink; see Resume Policies

Exit code 2 is a usage error, such as a missing --config or an invalid --abandon channel id; 1 is a failed start.

Contact US