Skip to content

Spillway Configuration Guide ​

Experimental Alpha

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

This guide is ordered by task: each section is a checklist for one thing you want to set up or change. It links to the page that explains each step rather than repeating it. Configuration is the full reference for every setting, its default and whether it applies on reload or at restart.

Spillway reloads spillway.yaml on save, so most recipes need no restart. The checks that call spillway_admin and $ADMIN use the helpers defined in Reaching the Admin API. The limits and defaults the recipes mention are listed in Limits and Defaults.

First Channel Inside DeltaFi ​

This sets up Spillway in DeltaFi's Compose stack with one channel and one data sink that sends to it.

  1. Choose the identity before the first start. Create <installDirectory>/config/spillway/spillway.yaml with your own instance.id and instance.cluster first, because instance.cluster names every S3 key and changing it later orphans the stored data. See Before the First Start. Skip this step to use the defaults, deltafi-spillway and compose.

  2. Enable Spillway in site/values.yaml with deltafi.spillway.enabled: true, give spool_dir a disk of its own and put s3_dir on a different filesystem, then run deltafi up. See Enabling Spillway.

  3. Add the channel under channels: in <installDirectory>/config/spillway/spillway.yaml and save. Adding a Channel has the minimal channel for DeltaFi's plugins certificate, and the configuration example is a fuller one.

  4. Load a data sink that sends to http://deltafi-spillway:8080/c/<channel>, with a metadataKey equal to the channel's. See Pointing a Data Sink at Spillway.

  5. Load the sink's resume policies, so a 503 or a Spillway restart becomes a DeltaFi retry. See Resume Policies below.

  6. Check it worked. The reload is logged, and the channel's status shows how deliveries are going:

    bash
    docker logs deltafi-spillway 2>&1 | grep -E 'configuration reloaded|configuration reload rejected' | tail -1
    spillway_admin "$ADMIN/admin/channels/consumer-a"

    configuration reloaded means the channel is running; configuration reload rejected means the file did not validate and the log line names why. A closed breaker alone says little, because a channel starts closed. Send a file through the data sink: "breaker": "closed" with backlog.local.files and backlog.retry.files near 0 means the consumer keeps up (files pass through), and the Flow row of the Spillway dashboard shows the producer and consumer rates (see Monitoring).

Standalone Spillway with mTLS ​

This sets up a Spillway host apart from DeltaFi, next to the consumers, with its own object store, metrics and Grafana.

  1. Put server.crt, server.key and ca.crt in the stack's certs/ directory. The server certificate must name the host that DeltaFi connects to, the key must be unencrypted, and ca.crt is the CA that the sending DeltaFi's client certificate and the operators' certificates chain to. See Certificates to Supply.

  2. Edit the stack's config/spillway.yaml. Set your own instance.id and instance.cluster before the first start, map each sender's certificate SAN to a source name in inbound.sourceSANs, list at least one admin.operatorSANs entry, and give each channel the sources it accepts:

    yaml
    instance:
      id: spillway-east
      cluster: standalone-east
    inbound:
      mode: mtls
      tls:
        cert: /certs/server.crt
        key: /certs/server.key
        clientCA: /certs/ca.crt
      sourceSANs:
        deltafi-prod.example: deltafi-prod
    admin:
      operatorSANs: [ops.example]
    storage:
      local:
        path: /spool
      s3:
        endpoint: http://s3proxy:9000
        bucket: spillway
        credentialsFile: /secrets/spillway-s3.env
    channels:
      - id: consumer-a
        sources: [deltafi-prod]
        outbound:
          url: https://consumer-a.example/ingest

    The storage block shown is the stack's own object store; the stack's file already has it, so edit the identity, the SANs and the channels there. In mtls mode Spillway refuses to start without admin.operatorSANs, and refuses a channel without sources.

  3. Bring the stack up with make standalone-up, or on a host without network access extract the bundle, add the certificates and run ./setup.sh. See Bringing It Up.

  4. Point the DeltaFi data sink at https://<spillway host>:8443/c/<channel>, with a metadataKey equal to the channel's. DeltaFi needs no certificate change, because its egress actions present the certificate deltafi ssl installs. See Pointing a Data Sink at Spillway and load the sink's resume policies.

  5. Plan certificate rotation. Replacing server.crt, server.key or ca.crt needs docker compose restart spillway; outbound credentials reload without one. See Credential rotation.

  6. Check it worked. Ask the admin listener with an operator certificate, as Reaching the Admin API shows for standalone:

    bash
    spillway_admin "$ADMIN/admin/channels/consumer-a"
    make standalone-status

    A channel object answers when the operator certificate chains to ca.crt and one of its SANs is in admin.operatorSANs; 401 client certificate required or 403 operator not allowed says which of the two is wrong. A DeltaFi send that gets 403 source not allowed has a certificate SAN that inbound.sourceSANs does not map to a source in the channel's sources.

Several Channels on One Volume ​

Channels that store files on the same local volume share it equally, and there is nothing to set. This recipe is what to do and expect when you add a second channel.

  1. Add the second channel to channels: and save, as in Adding a Channel. Adding a channel never changes another channel's limits.

  2. Size the volume for both channels together, as in Sizing Rules. The shares come from softLimitPct − hysteresisPct: at the defaults two channels holding files get 22.5% each. See Channels Sharing a Volume.

  3. Expect the behavior near the hard limit. From 75% to 80% usage at the defaults, a channel over its share gets 503 fair share, which DeltaFi resends through the resume policies of that channel's sink, while a channel under its share is still admitted. A slow channel gives up its own excess before a healthy channel's burst is touched.

  4. Make sure each channel's data sink has its own resume policies, named after that sink's egress action.

  5. Check it worked. Each channel answers on its own:

    bash
    spillway_admin "$ADMIN/admin/channels"

    Both channels appear in channels. Filter the Spillway dashboard's channel variable to compare them, and watch spillway_rejected_total{reason="fair_share"}, the 503 refusals by reason panel: it stays at 0 until usage reaches the band. See Refusal Reasons and the SOPs Consumer slow and Promotion blocked for a channel that holds more than its share.

AWS S3 Instead of s3proxy ​

Use AWS S3 when demoted data must survive power loss of the host, which s3proxy's filesystem backend does not guarantee. See Choosing an Object Store.

  1. Create a bucket for Spillway and an IAM credential scoped to that bucket only. Use SSE-S3, or SSE-KMS with bucket keys.

  2. Put the credential in spillway-s3.env as unquoted AWS_ACCESS_KEY_ID=… and AWS_SECRET_ACCESS_KEY=… lines: <installDirectory>/config/secrets/spillway-s3.env inside DeltaFi, secrets/spillway-s3.env in the standalone stack. Neither deltafi up nor setup.sh overwrites it.

  3. Point the object store settings at the bucket. This is a fragment of spillway.yaml; the rest of the file stays as it is:

    yaml
    storage:
      s3:
        endpoint: https://s3.us-east-1.amazonaws.com
        region: us-east-1
        bucket: spillway-prod
        credentialsFile: /secrets/spillway-s3.env

    Spillway addresses the bucket path-style, so use the regional endpoint. These settings apply at restart, although the credential file's contents apply live.

  4. In the standalone stack, remove the s3proxy service from compose.yaml and spillway's dependency on it. Inside DeltaFi the spillway-s3proxy service keeps running idle with its copy of the credential, so scope the credential to the Spillway bucket. See AWS S3 Instead of s3proxy.

  5. Restart Spillway.

  6. Check it worked. Spillway probes the object store at startup and logs the verdict:

    bash
    docker logs deltafi-spillway 2>&1 | grep -E 'object store probe passed|object store (unreachable|answers incorrectly)' | tail -1

    object store probe passed; the S3 tier is available means the bucket, endpoint and credential work. object store unreachable; running local-only and re-probing means Spillway could not reach the store or was refused, so recheck the endpoint, region, bucket and credential. object store answers incorrectly; running local-only and re-probing means a background re-probe, after a start that could not reach the store, found it answering wrongly; the same answer at the first probe stops Spillway from starting at all. In both of these cases Spillway runs local-only and probes again. /readyz answering ok does not tell the two apart, because it is ready once the probe has any verdict, including a store that is unreachable. Then open the S3 row of the Spillway dashboard: S3 requests shows 2xx codes by operation and no run of errors (see Monitoring). The s3 figure in a channel's backlog counts only segments whose footer has been read.

Sizing Disk, Connections and Threads ​

Size from the workload, not the defaults: the default maxConnections of 8 suits only small sites. This recipe walks the rules in Sizing Rules in order, using the values of the worked example, which serves one channel from one core-actions replica at λ = 965 files/s × 200 KB = 193 MB/s.

InputFormulaExample value
Soft limit, softLimitPct, for the longest slow episode served without S3soft ≥ (λ − μ_slow) × T_slow50% of the 9,264 GB volume is 4,632 GB; with the consumer down (μ_slow = 0), T_slow = 4,632 GB ÷ 193 MB/s = 24,000 s, about 6.7 h
Hard − soft gap, from hardLimitPct − softLimitPct, for an S3 outage while the consumer is also downhard − soft ≥ λ × T_S3outage193 MB/s × 14,400 s (4 h) = 2,779.2 GB, which at the default 30% gap needs a volume of 2,779.2 GB ÷ 0.30 = 9,264 GB
maxConnections, from the drain rate μ and the consumer's mean delivery time WmaxConnections ≥ μ × W ÷ 0.7μ = 2λ = 1,930 files/s, W = 20 ms: 1,930 × 0.020 ÷ 0.7 = 55.1, so maxConnections: 56
DeltaFi egress threads, deltafi action concurrency setthreads × replicas ≥ λ_pass × W + λ_spill × R_commitBurst: λ_pass = 2λ = 1,930 files/s and λ_spill = λ_peak − λ_pass = 4,847 − 1,930 = 2,917; 1,930 × 0.020 + 2,917 × 0.001 = 41.5, so 42, before headroom
maxStreams≥ the sink's egress threads across replicas ÷ Spillway instances42 × 1 ÷ 1 = 42
transferParallelism≥ ⌈(μ − λ) ÷ one promote stream's rate⌉ + 1⌈193 ÷ 172⌉ + 1 = 3; the default 8 covers it
Open files5 × Σ maxStreams + Σ (4 × maxConnections + 2) + 1,024 × transferParallelism + 2685 × 42 + (4 × 56 + 2) + 1,024 × 8 + 268 = 8,896
  1. Measure or estimate λ, the peak λ_peak, the consumer's drain rate μ and its mean delivery time W. For a consumer you cannot measure, use the worked example's assumptions as a first guess and correct them from the dashboard.

  2. Choose the volume from the soft-limit and gap rows. Put it on its own disk, formatted XFS or ext4 with -i 4096. See Single-Instance Target and Durability Profiles.

  3. Set the channel's connection and stream counts. This is a fragment of a channel, with the limits left at their defaults:

    yaml
    channels:
      - id: consumer-a
        maxStreams: 42
        outbound:
          url: https://consumer-a.example/ingest
          maxConnections: 56
  4. Raise DeltaFi's egress threads, which are shared by every sink of the HttpEgress class:

    bash
    deltafi action concurrency set org.deltafi.core.action.egress.HttpEgress 42
  5. Check the host's open-file limit against the budget. The Compose service sets 1,048,576; see Open-File Budget.

  6. Check it worked. A reload that does not fit the budget is rejected with the number it needs. With traffic flowing:

    bash
    spillway_admin "$ADMIN/admin/channels/consumer-a"
    deltafi action concurrency list

    In the channel's status, limit and inUse show the adaptive connection limit and slots busy: inUse near limit for long stretches says maxConnections is the bottleneck. projections.catchupSeconds shows the catch-up time of a backlog, and "promotionBlocked": false shows that promotion is not stalled. The list shows 42 for HttpEgress, with its source as an override. The stream cap shows as 503 stream cap in the 503 refusals by reason panel; none means maxStreams is high enough.

Outbound Authentication ​

A channel authenticates to its consumer with at most one of a client certificate, basic authentication or a bearer token, plus an optional CA bundle for a consumer certificate that DeltaFi's trust does not cover. Each of these is a fragment of one channel's outbound.

  1. Choose one method, and put its files where Spillway can read them. Inside DeltaFi, DeltaFi's plugins certificate is mounted at /certs and its key must be unencrypted. The password and token files need a mount of their own. Mount a directory, not the file itself: a single-file bind mount keeps seeing the old file when a rotation renames a new one over it. For example, a consumer-b directory holding password and a consumer-c directory holding token, mounted inside DeltaFi with this fragment of site/compose.yaml (in the standalone stack, add the same two lines to the spillway service's volumes in compose.yaml), and then deltafi up:

    yaml
    services:
      deltafi-spillway:
        volumes:
          - /etc/deltafi/consumer-b:/secrets/consumer-b:ro
          - /etc/deltafi/consumer-c:/secrets/consumer-c:ro

    This is a fragment of a Compose file, and the host paths are examples.

  2. Set the channel's outbound.auth. A client certificate with DeltaFi's plugins certificate, as inside DeltaFi (in the standalone stack /certs holds Spillway's own server certificates, so mount the sending certificate elsewhere):

    yaml
    channels:
      - id: consumer-a
        outbound:
          url: https://consumer-a.example/ingest
          auth:
            clientCert: { cert: /certs/tls.crt, key: /certs/tls.key }
            ca: /certs/ca.crt

    Basic authentication, with the password in a file:

    yaml
    channels:
      - id: consumer-b
        outbound:
          url: https://consumer-b.example/ingest
          auth:
            basic: { user: spillway, passwordFile: /secrets/consumer-b/password }

    A bearer token, with the token in a file:

    yaml
    channels:
      - id: consumer-c
        outbound:
          url: https://consumer-c.example/ingest
          auth:
            bearer: { tokenFile: /secrets/consumer-c/token }
  3. Save. A reload that changes outbound rebuilds the channel: it reads its credential files at once, and its adaptive limit and breaker start over.

  4. To rotate a credential later, replace the files in place or by rename, which needs the directory mount above, or by updating the Kubernetes Secret. Spillway reads them every 10 seconds and uses a change once two reads agree, within about 20 seconds, with no restart. See Credential rotation.

  5. Check it worked. After step 3, the reload is logged, and a reload whose credential files fail to load is rejected:

    bash
    docker logs deltafi-spillway 2>&1 | grep -E 'configuration reloaded|configuration reload rejected' | tail -1
    spillway_admin "$ADMIN/admin/channels/consumer-a"

    configuration reloaded means the channel was rebuilt with its credentials; configuration reload rejected names the file that did not load. Send a file, and deliveries succeed when "breaker": "closed" and backlog.retry stays at 0. After a rotation in step 4, the periodic refresh logs the change:

    bash
    docker logs deltafi-spillway 2>&1 | grep -E 'outbound credentials reloaded|outbound credential reload rejected' | tail -5

    outbound credentials reloaded names the channel; a rejected line means the new files do not load, and the channel keeps its running credentials. A breaker that opens right after a change usually means the consumer answers 401 or 403, which Spillway treats as a misconfiguration; see Consumer misconfigured.

Pausing a Consumer for Maintenance ​

Pause the channel before its consumer goes down. A paused channel delivers nothing and sends no probes, its arrivals spill to the local volume, and it raises no mismatch ticket.

  1. Check that the outage is affordable. A paused channel's data demotes first above the soft limit, so with S3 healthy the window need not fit between the limits. It needs S3 capacity of at least λ × the window, the window plus catch-up inside retentionHours, and, if S3 may also be down, a hard − soft gap of at least λ × the S3 outage. See the S3 capacity and hard − soft gap rows of Sizing Rules and its retention check.

  2. Pause the channel before the maintenance starts:

    bash
    spillway_admin -X POST "$ADMIN/admin/channels/consumer-a/pause"
  3. During the maintenance, watch storage and retention as in Consumer down for long.

  4. Resume the channel afterwards, and watch the Catch-up time panel:

    bash
    spillway_admin -X POST "$ADMIN/admin/channels/consumer-a/resume"
  5. Check it worked. Read the channel's status after each call:

    bash
    spillway_admin "$ADMIN/admin/channels/consumer-a"

    After the pause, "paused": true and "breaker": "paused", and backlog.local.files grows. After the resume, paused is false and the backlog drains to 0 in backlog.local, backlog.retry and backlog.s3. The pause survives a restart. See Planned consumer maintenance.

Tuning Pass-Through ​

By default Spillway streams a file straight through to a consumer that answers within 50 ms and buffers the rest. These are the three adjustments sites make. Each is a fragment of one channel.

  1. To buffer every file, for example to take DeltaFi off the consumer's response time entirely, set passThrough.mode: never. Every file then spills, and DeltaFi gets 200 {"status":"buffered","did":"<did>"} once the file is synced.

  2. To keep a flaky consumer from failing large files in flight, set passThrough.maxBytes, the largest file eligible for pass-through. Larger files spill. This is separate from passThrough.memoryBytes, which is the size up to which a pass-through goes through a memory buffer so that a consumer failure still ends in a local commit.

  3. For a consumer that answers 409 for a duplicate, list 409 in outbound.successStatuses, so a duplicate counts as delivered:

    yaml
    channels:
      - id: consumer-a
        passThrough:
          maxBytes: 100MiB
        outbound:
          url: https://consumer-a.example/ingest
          successStatuses: [409]

    This fragment sets maxBytes and successStatuses; for mode: never, replace maxBytes with mode: never, since maxBytes has no effect once every file spills. A status may appear in only one of successStatuses, passThroughStatuses and breakerStatuses. See Channels.

  4. Remember what pass-through costs DeltaFi: HttpEgress holds an action thread until Spillway answers, for up to passThrough.maxTime (50 ms) for a passed-through file and about a millisecond for a spilled one. See DeltaFi Thread Coupling.

  5. Check it worked. Send a file and read the channel's status:

    bash
    spillway_admin "$ADMIN/admin/channels/consumer-a"

    With mode: never, backlog.local.files rises as files arrive before their delivery, where under auto a healthy consumer leaves it near 0. The Spilled bytes panel in the Spill, DLQ and promotion row shows the spill rate. A 409 from the consumer counts as delivered once it is in successStatuses, so the file leaves the channel.

Test Hosts with One Disk ​

For a test host where Spillway must share a filesystem with other data, bound it with a byte budget. This is not for production: production layouts give the spool a disk of its own and leave maxBytes unset.

  1. Set storage.local.maxBytes in spillway.yaml. In the standalone stack, uncomment the stack's existing maxBytes: line in its storage.local block, because setup.sh finds only an uncommented maxBytes: in that committed layout, and do not paste a second storage: block. This is a fragment, and the limits are then fractions of maxBytes and not of the whole filesystem:

    yaml
    storage:
      local:
        maxBytes: 20GiB
  2. Run deltafi up for a Compose stack inside DeltaFi, or ./setup.sh for the standalone stack. Without maxBytes, both refuse a spool and an object store on one filesystem. With it they warn and continue. See Bounded test layouts.

  3. Restart Spillway if it was running, because maxBytes applies at restart.

  4. Check it worked. The command printed a warning and not an error, and Spillway's log does not warn that maxBytes is too large:

    bash
    docker logs deltafi-spillway 2>&1 | grep "storage.local.maxBytes exceeds the filesystem's capacity"

    No output is the good result. That warning means the whole-filesystem guard applies first; set maxBytes below the filesystem's capacity, and in practice below its free space. The Local storage pressure panel shows usage against the soft and hard limit lines.

Removing or Abandoning a Channel ​

A channel can be removed only when it holds nothing. Otherwise its data is delivered first, or aged off with audit rows by an explicit abandon.

  1. Point the data sink away from the channel first, so nothing arrives.

  2. Let the channel drain. Wait until its backlog.local, backlog.retry, backlog.dlq and backlog.s3 are all 0, or purge the DLQ if it holds files you will not replay (see Admin API).

  3. Delete the channel from channels: and save. A removal is refused, keeping the running configuration, while the channel holds anything or while the object store is unreachable. See Adding and Removing Channels.

  4. To remove a channel that still holds data you will not deliver, start Spillway with --abandon <channel>, then remove the channel from the file; the reload ages the data off with aged_off audit rows. In Compose the flag is set by overriding the service's command, as Orphaned channel data shows, and applied with deltafi up:

    yaml
    services:
      deltafi-spillway:
        command: ["--config", "/config/spillway.yaml", "--abandon", "old-channel"]

    This is a fragment of site/compose.yaml. Run deltafi up to apply it, then remove the channel from spillway.yaml. See Abandoning a Channel.

  5. Remove the override and run deltafi up again once the channel is gone, so a later reload that removes a channel of that name is checked again.

  6. Check it worked. The logs name the outcome, and the channel no longer answers:

    bash
    docker logs deltafi-spillway 2>&1 | grep -E "channel removed|channel abandoned|ageing off the abandoned channel's backlog failed" | tail -5
    spillway_admin "$ADMIN/admin/channels/old-channel"

    A reload that removes the channel, with or without --abandon, logs channel removed. channel abandoned is logged only for a channel that was already missing from the file at startup. If the age-off of an abandoned channel failed, ageing off the abandoned channel's backlog failed is logged as well, its remaining files stay, and channel removed alone is not success: retry once the object store answers. The status call then answers 404 unknown channel, and spillway_orphaned_bytes is 0 or absent.

Resume Policies ​

Every Spillway-backed data sink needs its own DeltaFi auto-resume policies, named after the sink's egress action. Without them a 503 from Spillway, or a Spillway restart, leaves the file errored in DeltaFi. The policies resend after a delay, up to 1,000 attempts.

  1. Render the policies for the sink's egress action, using its egressAction.name and every method it sends with (POST by default):

    bash
    docker exec deltafi-spillway /app/spillway resume-policies --action SpillwayEgress --method POST > spillway-SpillwayEgress.json
  2. Dry-run each policy, one --name at a time, to see how many errored DeltaFiles it would match:

    bash
    docker exec deltafi-spillway /app/spillway resume-policies --action SpillwayEgress --name spillway-SpillwayEgress-POST-503 > p.json
    deltafi auto-resume dry-run p.json
  3. Load them:

    bash
    deltafi auto-resume load spillway-SpillwayEgress.json
  4. To resume files that errored before the policies existed, run deltafi auto-resume apply spillway-SpillwayEgress-POST-503 spillway-SpillwayEgress-POST-connection. See Loading the Policies for the full procedure.

  5. Check it worked. List the policies:

    bash
    deltafi auto-resume list

    The list shows spillway-SpillwayEgress-POST-503 and spillway-SpillwayEgress-POST-connection. A 503 that Spillway answers then shows in DeltaFi as an error that resumes on its own, and the 503 refusals by reason panel shows the reason (see What a 503 Body Means).

Contact US