Documentation

Operations

This guide covers configuration reloads, reverse-proxy deployments, systemd, containers, and release operations.

Reloading, deploying, and stopping

Three distinct operations, three distinct verbs. They are separated because they mean different things and a deployment that conflates them either does not deploy or drops requests.

Verb Signal What it does Drops a request?
Reload configuration SIGHUP Re-reads the file and applies the reloadable settings No
Roll application code SIGUSR2 Replaces the worker processes, keeping every address No
Stop SIGTERM / SIGINT Stops accepting, finishes in-flight requests, then exits No

SIGUSR1 is deliberately ignored with a warning. It means "reopen the log" in nginx, so a logrotate script written for nginx sends it; volucer reopens its access log on SIGHUP instead. Ignoring it explicitly is not cosmetic — an unregistered signal keeps its default action, which for SIGUSR1 is to terminate the process.

SIGHUP does not deploy application code. It swaps configuration tables — sites, certificates, the rate limit, gRPC grants, which worker-control routes exist — and it leaves every PHP process exactly as it was. A worker or spawn_cgi slot keeps the code it loaded when it booted, which is the whole point of a persistent worker. Deploying new PHP means replacing those processes, and that is SIGUSR2.

Reloading configuration

On Unix, send SIGHUP. Windows has no SIGHUP equivalent, so restart the server there.

kill -HUP $(pidof volucer)      # or: systemctl reload volucer

Reloadable configuration is replaced as a single snapshot. New requests use the updated configuration; in-flight requests continue with the snapshot they started with. HTTP and FastCGI front ends share the same site configuration, so a reload applies to both.

Rolling application code

SIGUSR2 replaces the application processes with whatever is now on disk, without closing a listener and without dropping a request:

kill -USR2 $(pidof volucer)

It sweeps every slot and replaces the ones that are not serving a request. A slot that is mid-request is left alone and reported, so:

A sweep may not finish the roll in one pass. Each sweep replaces the idle slots; the busy ones are left for the next one. For a deployment under continuous load, run the sweep again until it reports that nothing was skipped — or accept that the roll completes on the next idle moment, which for a busy slot means the next deploy.

Three triggers, one implementation. Every one of them runs the same sweep, so they cannot disagree about what an idle slot is:

# 1. The signal, for a systemd unit or a supervisor.
kill -USR2 $(pidof volucer)

# 2. The command, which calls the [status] route. The deployment must grant it:
#      [status.workers] allow = ["workers.restart"]
volucer workers restart --config /etc/volucer/volucer.toml

# 3. The route directly, for a CI step or a supervisor that cannot send signals.
curl -f -XPOST http://127.0.0.1:2114/workers/restart

volucer workers restart exits non-zero when the sweep was accepted but is incomplete, so a pipeline can loop on it; --json prints the per-backend report, which names the slots that were replaced, skipped as busy, or failed.

What each backend kind does:

Backend A sweep…
worker replaces each idle slot's process, in place
spawn_cgi replaces each idle slot's process on its own address
attach does nothing — the supervisor that started those processes owns them
external (php-fpm) does nothing — reload php-fpm instead (SIGHUP/USR2 to its own master)
upstream restarts the origin if volucer supervises it; in-flight requests are lost

The attach and external rows are reported as unmanaged, with the reason, rather than counted as success. An upstream origin is the one kind that cannot be rolled without losing requests: it serves many at once and has no idle state, so the restart is announced and the origin's readiness gate is waited out before the sweep reports success.

Stopping

On SIGTERM (or Ctrl-C), Volucer stops accepting connections immediately, then lets the requests that are already in flight finish, up to [server] shutdown_timeout_ms (default 30 s). Requests still running when that expires are abandoned and the count is logged at warn, so a truncated request can be traced to a deadline rather than to the application.

Give your supervisor a longer grace period than that deadline, or it will SIGKILL mid-drain and produce exactly the truncation the drain exists to avoid:

Supervisor Setting to check
systemd TimeoutStopSec and KillSignal=SIGTERM
Docker docker stop -t <seconds>, or stop_grace_period in Compose
Kubernetes terminationGracePeriodSeconds

What a reload changes

The following settings can be reloaded:

  • [server.tls] and [sites.*.tls] certificates and keys
  • [sites.*] hosts, document_root, front_controller, script_extensions, serve_only, default_backend and routes
  • [server.static_files], including turning the layer on or off
  • redirect_to_https
  • A backend's grpc_services and grpc_serve_any — a widened grant admits the next call, on the same connection
  • A backend's grpc_proto. Volucer rereads the .proto files and applies newly declared services to subsequent calls. Files are not watched; changes take effect after a reload.
  • [server.rate_limit], with every tracked caller's bucket carried across when the key and header are unchanged
  • [status.workers] allow, in both directions

The following settings require a restart. Volucer reports them during reload:

Setting Why it cannot be reloaded
http, https, fastcgi A bound socket cannot move
Backends, their commands and worker counts Those are running processes with live pipes
[server.env] and a backend's env Existing processes retain their environment; replacement workers could otherwise receive different values from running workers
[server.tls] min_version and alpn They are baked into the rustls server config the acceptor holds
[server.proxy] Whose forwarded headers are believed is a statement about this deployment's topology
[server.access_log] path, format, request_id_header Chosen at startup. The log file is reopened on every SIGHUP regardless

A reload is whole-or-nothing

If configuration parsing or validation fails, Volucer logs the reason and continues serving with the previous configuration. It does not apply a partially valid configuration.

Files named by grpc_proto are read as part of configuration loading. An unreadable file or a set of files that resolves to no services also causes the reload to fail.

Files named by include are reread on every reload, so a drop-in edited in place takes effect on the next SIGHUP without touching the main configuration file. A missing file, an unreadable directory, or a cycle fails the reload and leaves the previous configuration serving — the same whole-or-nothing rule.

The site table and certificate table are applied independently, with sites applied first. If a certificate cannot be read, valid site changes can still take effect.

When [server.acme] is configured, issued certificates are retained across reloads. The certificate table is rebuilt from configuration, then certificates issued by ACME are registered again. This allows newly configured PEM files to load while keeping issued certificates active. If a name is no longer configured, its existing certificate remains registered. To migrate away from ACME, remove [server.acme] and restart the server.

Behind nginx

Volucer can serve HTTP and static files without nginx. If you use nginx, connect it to Volucer's FastCGI listener:

[server]
fastcgi = "127.0.0.1:9080"
document_root = "/srv/app/public"

A unix socket works in the same place and saves a loopback round trip — fastcgi_pass and proxy_pass both take one:

[server]
fastcgi = "unix:/run/volucer/fcgi.sock"
document_root = "/srv/app/public"

Two things differ on a socket, and both are properties of the transport rather than settings: the socket has no client address, so REMOTE_ADDR on the HTTP front-end is absent (on the FastCGI front-end the parameter is nginx's to set and is relayed verbatim), and it has no port, so redirect_to_https is refused for a socket-only listener. See Configuration. Both front-ends remove a stale socket path before binding and remove it again on a clean stop, so an unclean shutdown does not need manual cleanup.

server {
    listen 80;
    server_name example.com;
    root /srv/app/public;
    index index.php;

    location / {
        try_files $uri /index.php$is_args$args;
    }

    location ~ ^/index\.php(/|$) {
        fastcgi_pass 127.0.0.1:9080;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
}

In nginx, try_files treats every argument except the last as a file test. This means that the following front-controller configuration is unsafe:

The obvious spelling of a front controller is:

location / { try_files /index.php =404; }
location = /index.php { fastcgi_pass ...; }

In this configuration, /index.php is tested as a file and may be served as static content, exposing the PHP source. The last try_files argument is the fallback, not the first. The example above instead uses the script as the fallback and routes it to the FastCGI location.

To have Volucer use the original client address for access logs and rate limiting, configure nginx's trusted address range and forwarded header:

[server.proxy]
trusted_subnets = ["127.0.0.1"]
trusted_headers = ["X-Forwarded-For"]

HTTP/3: UDP reachability and MTU

HTTP/3 is served on the UDP address in [server.http3] listen, and browsers only learn about it from the Alt-Svc header Volucer sends on TLS responses. Three things therefore have to be true at once, and each fails in a different way.

The UDP port must be reachable. This is the common one, and it fails silently: the TCP listener answers normally, Alt-Svc advertises the QUIC endpoint, the browser attempts QUIC, its datagrams are dropped, and it falls back to TCP after a retry delay. Nothing errors, and the only symptom is a site that feels slow on the first request.

# Check the container or host publishes UDP, not only TCP:
docker run -p 443:443/tcp -p 443:443/udp ...

# Check the firewall:
sudo ufw allow 443/tcp
sudo ufw allow 443/udp        # the line that is easy to forget

# From outside, with a client that speaks HTTP/3:
curl --http3-only -sI https://example.com

If curl needs --http2 to succeed, that is the signature of exactly this problem.

The path MTU must not black-hole large datagrams. QUIC sends most of its traffic in datagrams near the path MTU, and a link that drops ICMP "fragmentation needed" will carry the handshake and then stall. Volucer's max_body_bytes is not the relevant limit — the failure is in the network. quinn does path MTU discovery, so a modern path recovers; a path behind a tunnel or a middlebox that filters ICMP does not. Symptoms are HTTP/3 connections that complete their handshake and then hang on the first large response.

Alt-Svc has a lifetime. alt_svc_ma_seconds (default one day) is how long a browser caches the endpoint. Removing [server.http3] from a running deployment therefore does not take effect immediately for returning visitors: they will keep attempting the UDP endpoint until their cached value expires, and fall back. That is the reason not to lower the default carelessly, and the reason a rollback of HTTP/3 is a one-day event rather than an instant one.

volucer check prints the [server.http3] block, and the listener's shutdown line reports requests, connections, handshake failures and oversized header sections — a non-zero handshake failure count on a port that should be idle is the signal that something between the client and the server is interfering with UDP.

systemd

The unit that ships with volucer:

[Unit]
Description=volucer PHP application server
Documentation=https://github.com/sailantis/volucer
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/volucer serve --config /etc/volucer/volucer.toml
ExecReload=/bin/kill -HUP $MAINPID

KillSignal=SIGTERM
TimeoutStopSec=30

Restart=on-failure
RestartSec=1
User=volucer
Group=volucer
StateDirectory=volucer
WorkingDirectory=/var/lib/volucer

# Two file descriptors per client connection are needed as soon as TLS or the backend pool
# is in play, and systemd's default of 1024 is the same wall a shell's `ulimit -n` is: past
# it, connections fail to accept and the log says "Too many open files". This has to exceed
# `[server] max_connections` — see [Scaling a single process](#scaling-a-single-process) for
# why that key, not the core count, is usually what limits a large host.
LimitNOFILE=65536

NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
ReadWritePaths=/var/lib/volucer

[Install]
WantedBy=multi-user.target

ExecReload sends SIGHUP to reload configuration. If the new configuration is invalid, the server continues using the previous one.

It does not deploy application code. To put new PHP in front of the same addresses, send SIGUSR2 — there is no ExecReload= verb for it because systemd maps a unit's reload to one signal, and the two operations are different:

# Roll the workers with the code that is now on disk. Keeps both listeners open and
# replaces only the slots that are idle, so no request is dropped.
systemctl kill -s SIGUSR2 volucer

A deploy therefore looks like: copy the new code into place, systemctl kill -s SIGUSR2 volucer, then (only if the configuration also changed) systemctl reload volucer. Reversing the order would deploy the old code under the new configuration.

You can also provide configuration through command-line arguments instead of a configuration file:

ExecStart=/usr/local/bin/volucer serve \
    --listen 127.0.0.1:8080 \
    -o server.document_root=/srv/public \
    -o server.front_controller=index.php \
    -o backends.app.kind=worker \
    -o "backends.app.command=php /srv/public/worker.php" \
    -o backends.app.workers=0

On SIGHUP, Volucer reapplies the same command-line overrides. Without a configuration file, there are no file changes to read. Changes to ExecStart take effect only after the service restarts.

On SIGTERM, Volucer stops accepting connections immediately, then lets the requests that are already running finish before exiting. Worker processes are stopped with the server.

That grace period has a budget: server.shutdown_timeout_ms, thirty seconds by default. When it expires, whatever is still in flight is abandoned and the count is logged at warn, so a truncated response is visible rather than indistinguishable from a fast one.

The budget must be shorter than whatever waits before killing the process. systemd's TimeoutStopSec and a container's stop_grace_period both default to thirty seconds, which is why the default budget matches them — an operator who has changed neither gets a drain that completes. If you raise shutdown_timeout_ms, raise the supervisor's timeout above it as well, or SIGKILL will land mid-drain and truncate exactly what the setting exists to protect.

[server]
shutdown_timeout_ms = 10000     # default 30000; 0 means "do not wait at all"

Store the ACME cache under the systemd state directory and configure the cache path to match StateDirectory:

[server.acme]
cache = "/var/lib/volucer/acme-cache"

Secrets and environment

Volucer does not load a .env file itself. Use systemd's EnvironmentFile=, Docker's --env-file, or Compose's env_file: to provide variables. Volucer can expand those variables in configuration using ${...}:

# the unit
Environment=APP_ENV=production
EnvironmentFile=/etc/volucer/secrets.env
# the configuration
[server]
http = "127.0.0.1:${PORT:-8080}"

[backends.app]
kind = "worker"
command = "php worker.php"
workers = ${WORKERS:-0}

Variables set directly in the unit take precedence over values from EnvironmentFile=. Expanded values can be passed to applications through [server.env] or a backend's env table. config.describe displays variable names without their values.

volucer check performs the same expansion as serve and reports missing variables before you restart the service.

Health checks

The [status] listener provides separate liveness and readiness probes:

[status]
address = "127.0.0.1:2114"
volucer health --url http://127.0.0.1:2114/health   # is the process running?
volucer health --url http://127.0.0.1:2114/ready    # should traffic be sent here?

curl -sf can query these endpoints as well. The volucer health command is useful in minimal containers that do not include curl; see Health checks in the image.

/health returns 200 while the process is running, even if its services are not ready. Use it as a liveness check to decide whether the process should be restarted.

/ready returns the configured unavailable_status (503 by default) until all services report ready. Use it to determine whether the instance should receive traffic.

Both endpoints return 404 for other paths. Bind the status listener to loopback or a private interface and restrict access through the deployment network.

[status.workers] allow adds worker-control routes to the same listener. See Observability before turning it on — there is no authentication for those routes, and naming workers.list alone grants only the read.

Docker

Use a published image or build one from a source checkout.

Pulling a published image

Each release publishes musl and glibc images to GitHub Container Registry for linux/amd64 and linux/arm64:

docker pull ghcr.io/sailantis/volucer:latest          # musl, scratch-based: the recommended one
docker pull ghcr.io/sailantis/volucer:latest-glibc    # Debian-based, if you need a libc

The default musl image uses a scratch base and has no libc dependency. The glibc image uses a Debian base and always has a -glibc suffix:

Tag Image
0.5.0, 0.5, latest musl, scratch base
0.5.0-glibc, 0.5-glibc, latest-glibc glibc, debian:bookworm-slim

The latest tag changes only for final releases. A pre-release such as v0.5.0-rc.1 publishes the 0.5.0 and 0.5 tags without moving latest. Pin a version such as 0.5.0 for deployments that must not change when a new release is published.

The package must be made public after the first release publishes it. See Publishing; once public, pulling the image does not require docker login.

Building it yourself

packaging/docker/Dockerfile builds both images from the same crate. On a 4-vCPU machine with a cold Cargo cache, builds take approximately 3m45s for musl and 1m40s for glibc:

docker build -f packaging/docker/Dockerfile --target musl -t volucer .           # the host's architecture
docker build -f packaging/docker/Dockerfile --target glibc -t volucer:glibc .

The -f option is required because the Dockerfile is in packaging/docker/. Use the repository root as the build context because COPY . . needs the full Cargo workspace.

--target musl selects the Rust target based on --platform. For example, docker build -f packaging/docker/Dockerfile --platform linux/arm64 --target musl produces an aarch64 binary. If an architecture has no musl target, the build fails rather than falling back to another architecture.

The two images are 23 MB (musl, scratch) and 149 MB (glibc, debian:bookworm-slim).

The binary is built into the image, so there is no archive to download or verify separately. .dockerignore excludes target/ and .git/ from the build context. Without this, the repository's potentially large target/ directory would be uploaded and copied into a layer before the build begins.

Running it

Both images use the same runtime contract. Replace the local image name with a published image to use a release build:

docker run --rm \
    -p 8080:8080 -p 9080:9080 \
    -v "$PWD/volucer.toml:/etc/volucer/volucer.toml:ro" \
    -v "$PWD/public:/srv/public:ro" \
    ghcr.io/sailantis/volucer:latest

You can run the image without mounting a configuration file by providing settings on the command line:

docker run --rm -p 8080:8080 -p 9080:9080 -v "$PWD/public:/srv/public:ro" \
    ghcr.io/sailantis/volucer:latest \
    serve --listen 0.0.0.0:8080 --document-root /srv/public \
        -o server.front_controller=index.php \
        -o backends.app.kind=worker \
        -o "backends.app.command=php /srv/public/worker.php" \
        -o status.listen=0.0.0.0:9080

The image's ENTRYPOINT is the Volucer binary. Arguments after the image name replace the default serve --config /etc/volucer/volucer.toml, so include the serve subcommand.

The image's HEALTHCHECK normally reads [status] from a configuration file. For a fileless container, configure the check with a URL such as HEALTHCHECK CMD ["/volucer", "health", "--url", "http://127.0.0.1:9080/health"]. See Health checks in the image.

In a container, configure both listeners to bind to addresses reachable from outside the container:

[server]
http = "0.0.0.0:8080"          # not 127.0.0.1: the port has to be reachable from outside
document_root = "/srv/public"

[status]
listen = "0.0.0.0:9080"        # what `docker exec ... health` probes, and what EXPOSE names

Listeners bound to 127.0.0.1 are reachable only within the container's network namespace. Publishing such a port with -p does not make the listener externally reachable.

Adding PHP to the image

The published images contain only Volucer: the musl image is scratch and the glibc image has no PHP runtime. A worker such as command = "php worker.php" therefore needs an application image with PHP.

Use the CI-built and verified recipes: Dockerfile.ubuntu or Dockerfile.alpine. The verify.sh test starts each image, waits for its health check, and serves a request. Treat the Dockerfiles as the source of truth.

Build from the repository root:

docker build -f examples/docker/Dockerfile.ubuntu -t app .
docker build -f examples/docker/Dockerfile.alpine -t app:alpine .

The Ubuntu recipe uses distribution PHP packages instead of the compiler toolchain retained by the official php image for docker-php-ext-install. Sizes below are decimal MB from docker image ls on linux/amd64:

Image On disk To pull
php:8.5-cli-bookworm 798 MB 181 MB
the same, plus the Volucer binary 819 MB 189 MB
ubuntu:26.04 + php8.5-cli + Volucer 229 MB 55 MB
the same, plus cgi, mbstring, curl, xml and sqlite3 287 MB 69 MB
examples/docker/Dockerfile.ubuntu (+ Composer and the application) 294 MB 71 MB
examples/docker/Dockerfile.alpine (the same, on musl) 98 MB 23 MB
the Ubuntu recipe plus mysql, intl, bcmath and gd 376 MB 93 MB

The official image's extra size is largely its compiler toolchain (~330 MB) and PHP build headers (~170 MB); Ubuntu's php8.5-cli package is a 12 MB prebuilt binary. Ubuntu 26.04 provides PHP 8.5 directly; Ubuntu 24.04 stops at 8.3 and needs packages.sury.org/php.

# See the CI-verified Dockerfile above for the full recipe. Ubuntu's `php8.5-cli`
# includes `pcntl` (required by `attach`); install `ca-certificates` for TLS and
# `unzip` for Composer. The base image provides `www-data`.
FROM ubuntu:26.04

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        php8.5-cli php8.5-cgi php8.5-mbstring php8.5-curl \
        php8.5-xml php8.5-sqlite3 php8.5-zip unzip ca-certificates \
    && rm -rf /var/lib/apt/lists/*

COPY --from=ghcr.io/sailantis/volucer:0.6.0-glibc /usr/local/bin/volucer /usr/local/bin/volucer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

WORKDIR /srv/app
COPY examples/docker/app /srv/app
RUN composer install --no-dev --no-interaction --optimize-autoloader \
    && chown -R www-data:www-data /srv/app

USER www-data
EXPOSE 8080 9080
ENV VOLUCER_HEALTH_CONFIG=/etc/volucer/volucer.toml
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
    CMD ["/usr/local/bin/volucer", "health"]

ENTRYPOINT ["/usr/local/bin/volucer"]
CMD ["serve", "--config", "/etc/volucer/volucer.toml"]

The configuration then refers to php by name. Both binaries are already on PATH (/usr/bin/php and /usr/bin/php-cgi), so no path needs to be written into it:

[server]
http = "0.0.0.0:8080"
document_root = "/srv/app/public"    # the WORKDIR above, plus the application's own public/
front_controller = "index.php"

# `volucer health` probes this listener; bind to 0.0.0.0 for container access.
[status]
listen = "0.0.0.0:9080"

[backends.app]
kind = "worker"
command = "php worker.php"
working_dir = "/srv/app"

Bind both listeners to 0.0.0.0 (see Running it):

docker run --rm -p 8080:8080 -p 9080:9080 \
    -v "$PWD/volucer.toml:/etc/volucer/volucer.toml:ro" \
    my-app

The app and document root are in the image; mount only the config. Config edits take effect after docker restart.

Key differences from the official php image:

  • pcntl is built into php8.5-cli, along with posix, sockets, and SysV IPC. attach requires these; the official PHP image needs docker-php-ext-install pcntl.
  • OPcache is included. CLI OPcache is off by default; spawn_cgi uses opcache.enable, which defaults on.
  • Extensions are separate Ubuntu packages. The recipe installs mbstring, curl, xml, sqlite3, and zip; add php8.5-mysql, php8.5-intl, php8.5-bcmath, or php8.5-gd as needed. Ubuntu and the official image have different extension sets; compare php -m rather than assuming either is a superset.
  • CGI is optional. Install php8.5-cgi only for spawn_cgi; it adds about 32 MB and uses /etc/php/8.5/cgi/ settings. CLI settings are under /etc/php/8.5/cli/.
  • The recipe includes ca-certificates for TLS and runs as www-data. Ensure application directories such as Azera's writable/ are writable by that user.

Ubuntu defines no HEALTHCHECK, so the recipe adds the Volucer health check described in Health checks in the image.

Ubuntu has no ENTRYPOINT; arguments run through Volucer. To run PHP, specify it explicitly:

docker run --rm --entrypoint php my-app -m
docker exec my-app php -m                 # in a running container

Alpine

examples/docker/Dockerfile.alpine provides the same verified setup on musl: 98 MB versus 294 MB for Ubuntu. Its PHP packages need a few explicit steps:

  • Alpine installs /usr/bin/php85, so the recipe creates /usr/bin/php for commands such as php worker.php.
  • Install php85-pcntl for attach, and php85-phar, php85-zip, and unzip for Composer.
  • Install php85-sockets and php85-posix for the Unix-socket relay used by attach.

PHP 8.5 requires Alpine 3.23 (3.22 provides 8.4). The published musl image is the default Volucer image, so its tag has no -glibc suffix. CI verifies the Alpine recipe with the same verify.sh used for Ubuntu; compare installed extensions rather than assuming Alpine includes Ubuntu's packages.

Health checks in the image

Both images define a HEALTHCHECK that runs the Volucer binary directly:

HEALTHCHECK CMD ["/usr/local/bin/volucer", "health"]

The musl image uses FROM scratch, which contains neither a shell nor curl. A shell-based health check would therefore fail to run. The volucer health command is self-contained and returns an exit code suitable for Docker. It reads the listener address from [status]. It exits successfully only for a 2xx response; other statuses, including 404, fail the check. Diagnostic details are written to stderr and appear in Docker's health log:

$ docker inspect --format '{{json .State.Health}}' volucer | jq -r '.Log[].Output'
volucer: could not connect to 127.0.0.1:9080: connection refused

The command chooses its probe target using these settings, in order of increasing precedence:

Setting Effect
the default file volucer.toml, then .volucer.toml, in the working directory.
VOLUCER_CONFIG The configuration file to read, shared with serve.
VOLUCER_HEALTH_CONFIG The configuration file to read, for this probe only. The image defaults to /etc/volucer/volucer.toml; set this if the file is mounted elsewhere.
VOLUCER_HEALTH_URL A URL to probe instead of reading the configuration.
--url / --config The flags, which win over all of them — so a variable someone forgot does not fight a probe typed by hand.

The image's built-in health check uses /health, not /ready. A failed Docker health check may lead to a container restart, so a server should not fail it merely because its worker pool is still starting. Use /ready separately for a load balancer or another component that decides whether to send traffic:

docker exec volucer volucer health --ready

Compose

Use a published image, or build from the checkout:

services:
  app:
    image: ghcr.io/sailantis/volucer:0.5.0 # or: build: {context: ., target: musl}
    ports:
      - "8080:8080"
      - "9080:9080"
    volumes:
      - ./volucer.toml:/etc/volucer/volucer.toml:ro
      - ./public:/srv/public:ro
    environment:
      APP_ENV: production
    env_file:
      - secrets.env
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "/usr/local/bin/volucer", "health", "--ready"]
      interval: 10s
      timeout: 3s
      retries: 3
      start_period: 20s

The Compose healthcheck: block replaces the image's default health check. Use /ready there when the check is used to decide whether the application should receive traffic. Choose a start_period long enough for the worker pool to start; otherwise, a slow but successful startup may fail the health check.

Use environment variables and ${...} expansion to provide configuration values, for example http = "0.0.0.0:${PORT:-8080}". Compose's env_file: and Docker's --env-file provide the variables; Volucer does not load .env files itself.

The access log and logrotate

On SIGHUP, Volucer closes and reopens the access-log file. Configure logrotate to signal the server after rotating the file:

/var/log/volucer/access.log {
    daily
    rotate 14
    compress
    postrotate
        kill -HUP "$(pidof volucer)"    # or: systemctl reload volucer
    endscript
}

The log is reopened even if configuration reload fails. For supported formats and details, see Observability.

Installing the binary

Use the install scripts to install the binary. See Getting Started.

Each release includes a target-specific archive and a corresponding .sha256 checksum file:

volucer-0.1.0-x86_64-unknown-linux-gnu.tar.gz
volucer-0.1.0-x86_64-unknown-linux-musl.tar.gz
volucer-0.1.0-aarch64-unknown-linux-gnu.tar.gz
volucer-0.1.0-aarch64-apple-darwin.tar.gz
volucer-0.1.0-x86_64-apple-darwin.tar.gz
volucer-0.1.0-x86_64-pc-windows-msvc.zip

Each archive contains the binary, README, license, and systemd unit.

Sizing the runtime

Volucer runs one multi-threaded Tokio runtime, and by default Tokio starts one worker thread per core. That default is tuned for a CPU-bound server and this one is not: a request spends its time waiting for a backend process, not computing. On a machine with many cores the extra threads mostly contend with each other, and the measurement is unambiguous.

On a 12-core host with an external backend in front of 96 php-fpm children, same binary and same configuration, varying only TOKIO_WORKER_THREADS:

concurrency 12 threads (default) 4 threads throughput front-end CPU
12 28,168 rps 30,625 rps +8.7% −8.7%
100 54,229 rps 55,740 rps +2.8% −10.0%
400 62,920 rps 64,103 rps +1.9% −10.5%

Four threads is better or equal everywhere and costs about a tenth less CPU per request. Below that it falls off a cliff — two threads on the same host drop to 38,280 rps at concurrency 100, because there is no longer enough parallelism to keep the backend busy.

The setting is Tokio's own environment variable, so it needs no key in the configuration:

TOKIO_WORKER_THREADS=4 volucer serve --config volucer.toml

Under systemd, put it in the unit:

[Service]
Environment=TOKIO_WORKER_THREADS=4
ExecStart=/usr/local/bin/volucer serve --config /etc/volucer/volucer.toml

Pick the number from your concurrency rather than your core count. The useful range in the measurements above is 4–8 on 12 cores; the ceiling is where per-request CPU starts rising again, which means the runtime threads are the queue. If you are unsure, leave the default — it is correct, just not optimal — and measure with volucer status before and after.

Scaling a single process

Throughput is linear in cores up to the point where the cores run out, and a single process uses all of them. Measured on the 12-core reference host with an attach backend and 96 children, pinning the front-end and the supervisor to N cores, at concurrency 400:

cores throughput rps per core front-end CPU per request
12 101,022 rps 8,418 46.9 µs
8 80,154 rps 10,019 47.3 µs
6 59,212 rps 9,869 47.5 µs
4 39,114 rps 9,778 48.0 µs
2 19,250 rps 9,625 49.6 µs

Per-request cost is flat to within 6% across the whole range, and from 2 to 8 cores throughput tracks the core count at ~10,000 rps per core. The last row is not linear and is not a ceiling: 8 → 12 cores is 1.26× throughput for 1.50× cores, because at 12 the box is full — front-end 4.67 + PHP 4.90 + load generator 1.93 = 11.50 of 12 cores, 96% busy. The cell measures how much of the machine the whole arrangement needs, not how far the front-end can scale, and the generator is on the same cores it is measuring. Read the table as "one process consumes ~0.8 cores per 10,000 rps", not as a per-core rate that holds at every count.

That the 12-core point is CPU-bound rather than serialised is confirmed from the other side: at a fixed 96 children, concurrency 100 → 200 → 400 gives 101.5k → 102.1k → 102.2k with the box at 98–100% busy. Throughput stops because the CPU is gone; nothing is waiting on a lock.

So there is no per-process serialisation to work around, and one process on a bigger host is the right answer before several processes on the same host — running two front-ends against one pool was measured slower than one (91–95k against 97k) because the same work is then done less efficiently.

Correction (measured later, on the same host): that conclusion was about thread oversubscription, not about process count. The test behind it ran two processes with twelve runtime threads each — 24 threads on 12 cores, neither pinned — which is measurably no better than one process (54.7k against 53.9k). What actually matters is how many cores the front-end's threads are spread over, and a single process is spread across all of them:

layout (one pool, 96 children, c=100) rps p50 front-end CPU/req
1 process × 12 threads 53,446 1.67 ms 53.9 µs
4 processes × 12 threads, pinned to 4 cores 67,807 1.24 ms 42.2 µs
4 processes × 12 threads, unpinned (12 cores) 54,692 — 58.6 µs

Pinning is the whole effect: the same four processes on four cores gain 27%, and released onto twelve lose all of it. A single process on fewer cores shows the same thing (54.1 µs of front-end CPU per request on twelve cores, 47.4 µs on two, at concurrency 100). The per-request cost is a cache-locality property — a request's data polled by threads on more cores is fetched from more places — so the more cores a front-end's threads span, the more each request costs, even though more cores raise the ceiling. nginx and Node's cluster get this for free by running one event loop per process.

There is no configuration key for this yet: it needs several processes behind one address (SO_REUSEPORT, not implemented) or an external load balancer, with each front-end confined (CPUAffinity= under systemd) to a couple of cores. Measured against nginx in front of the same pool, that layout is 68,796 rps against nginx's 63,763 at concurrency 100 (four rotated rounds) and 76,545 against 70,829 at concurrency 200.

If a single process on the largest host available is still short, prefer more processes confined to few cores each over one process spread across all of them, and more hosts after that.

Two things cap a single process long before the cores do, and both are configuration:

  • [server] max_connections, default 512. It refuses a connection beyond the ceiling by closing it: no status code, no Retry-After, nothing but a reset at the TCP layer — so a client pool that keeps more connections open than this sees errors rather than backpressure. At concurrency 600 the default ceiling served 78.5k rps where the same configuration uncapped served 101.0k. Raise it to at least the number of connections your clients hold open, and raise the file-descriptor limit to match: the default ulimit -n of 1024 is the next wall after 512. Under systemd that is LimitNOFILE=65536 in the unit (the unit above has it); in a container it is the runtime's --ulimit nofile= or the orchestrator's equivalent.
  • The child count. Children are what the pool draws from; past the knee they are memory and context switches for no requests. On this host throughput went 61.1k → 84.1k → 96.5k → 101.7k for 12 → 24 → 48 → 96 children, and 144 gave 101.2k. Sizing children at roughly one per core gets most of it; the last few percent needs two or three per core.

If a single process on the largest host available is still short, run more hosts. Several processes on one host only help in the shape described above — each confined to a few cores — and unpinned they are no better than one process, which is the measurement the earlier version of this section mistook for a statement about process count.

Whatever the layout, do not count the same address twice. max_connections is per listener, so N processes on N ports give N times the ceiling, and the same is true of the connection registry, the counters, the rate limit and the access log — every one of those is per process because volucer has nothing shared between processes. Three processes are three independent servers that happen to run the same configuration, and everything an operator reads from one of them is a third of the truth.

One host-level note, since it is free: check cat /sys/devices/system/clocksource/clocksource0/current_clocksource. Under a hypervisor it is often xen, which is not vDSO-eligible, so every clock_gettime is a real syscall — about 16 per request on the reference host. Switching to tsc (available there with constant_tsc) removed 2.7 µs of front-end CPU per request, worth +2.8% throughput. This is a host setting, not a volucer one, and it is worth checking before buying capacity.

Re-measured on the same host against the current build, GET /items, attach, 32 workers, c=96, alternating the clocksource every round so drift lands on both equally:

clocksource throughput front-end CPU
xen 37,385 rps 60.6 µs/req
tsc 38,309 rps (+2.5%) 57.8 µs/req (−4.6%)

The syscall cost is the whole of it: time.monotonic_ns() is 245 ns under xen and 104 ns under tsc, and PHP's hrtime() is 191 ns against 57 ns. That is why the figure keeps reproducing across builds and backends — it is a property of the host, not of the code, and it is paid by every PHP process as well as by volucer. Two related costs are not worth chasing: opcache.huge_code_pages measured inside the noise, and the jemalloc allocation that a perf profile shows at 1.4% of the front-end is cheaper than the code that would remove it.

Running as a different user

Volucer needs read access to the document root and write access to the ACME cache. It does not need write access to its binary, configuration, or document root. The systemd unit's ProtectSystem=strict and ReadWritePaths settings reflect these requirements.

When running Volucer as a non-root user, grant that user read access to the document root and write access to the ACME cache. PHP-CGI and worker processes run as the same user and need the corresponding access.

Upgrading

  1. Review the changelog for the target version.
  2. Install the new binary alongside the current one, or replace the current binary.
  3. Run volucer check --config volucer.toml with the new binary to verify the configuration.
  4. Restart the service.

Configuration is strict. If the new version no longer accepts a setting, volucer check reports the problem and the server refuses to start rather than silently ignoring or reinterpreting the setting.