Documentation
92 documents, generated from the docs/ directory of the ScalWS repository. Start with Getting started, then Architecture.
Start here 2
- Getting started
A Linux-first web and application server written in Rust: fast, observable, secure and multi-tenant, with PHP, Node.js, Python and arbitrary upstreams as first-class runtimes.
- Changelog
All notable changes are recorded here. Format: Keep a Changelog.
Architecture 2
- Architecture
Status: living document. Reflects the code as of milestone M9 (operations). The engineering contract is SCALWSNextGenWebServerClaudeCodeHandoff.docx; this file explains how the code realizes it and where it does not yet.
- Decision log
Significant decisions get an ADR in docs/adr/. Smaller ones are logged here with date and reason so they can be revisited.
Adaptive Runtime 5
- ScalWS Adaptive Runtime: design summary, configuration and benchmark plan
Design ADRs: 0033 (control/data plane, reuseport), 0034 (PressureScore, classification), 0035 (lifecycle, drain, generations, recovery), 0036 (multi-instance state). Rollback point: pre-adaptive-runtime-2026-10-06.
- Adaptive Runtime: final report (2026-10-07)
Design: ADR-0033 … 0036 and docs/adaptive-runtime.md (architecture diagram, configuration reference). Rollback point: pre-adaptive-runtime-2026-10-06 (VERIFIED, docs/pre-adaptive-runtime-backup.md). Benchmarks: docs/benc
- Listener generations: changing listeners without restarting the controller
Design: ADR-0037. Applies to scalws-controller with listen: inherited (the default).
- Connection distribution: what is measured and what it means
Design: ADR-0038. Applies to several instances under scalws-controller.
- HTTP/3 with several instances: operation
Design: ADR-0039 (transport plane), ADR-0040 (connection IDs), ADR-0041 (lifecycle). TCP (HTTP/1.1, HTTP/2) is unchanged: one shared accept queue per address (listen: inherited).
Operations 1
- Operations guide
From the ScalWS apt repository (Ubuntu 24.04 or later, Debian 13 or later, amd64):
Console 6
- ScalWS Console: architecture
ScalWS Console is the web administration of a ScalWS host, shipped with ScalWS the way LiteSpeed WebAdmin ships with LiteSpeed Web Server: the same packages and release artifacts (scalwsd, scalws-controller, scalwsctl, s
- ScalWS Console: installation and operation
ScalWS Console is part of the standard ScalWS distribution: the DEB/RPM packages built by scripts/package.sh contain /usr/bin/scalws-console and scalws-console.service, next to scalwsd, scalws-controller and scalwsctl.
- ScalWS Console: configuration workflow
The console never edits the active configuration in place. Every change is a transaction over the configuration file the controller reads (controller.config in controller.yaml), and the controller turns the file into a n
- ScalWS Console: roles and capabilities
Roles are fixed sets of capabilities (cmd/scalws-console/src/rbac.rs). Every API handler names the capability it needs and checks it on the server; the browser only hides what the session cannot do. Sensitive actions als
- ScalWS Console: security and threat model
/etc/scalws/console/credentials (packaged installs; <statedir>/credentials otherwise), mode 0600, one account per line:
- ScalWS Console: test and security report (2026-10-07, updated 2026-10-08)
Build: cmd/scalws-console at the commit that adds it; demo stack on the development VM (scripts/console-demo.sh): its own scalws-controller (state [private host path], listeners 127.0.0.1:28080/28443, metrics 39910+, CPU
Security 3
- Threat Model
Status: living document, revised at every milestone's security review. Scope today: M1 serving core (listeners, TLS, HTTP/1.1 + HTTP/2, routing, static files, reverse proxy, metrics endpoint, config reload) and M2 manage
- Security audit of the own HTTP/1 code (run-2, 2026-10-09)
Scoped standard run of the security-audit workflow over the new code: crates/scalws-h1, crates/scalws-http/src/h1server.rs (+ conn.rs dispatch), crates/scalws-core/src/upgrade.rs and the experimental upstream client (cra
- Hardening pass 1: fuzzing and wire-level attacks (2026-10-09)
Development VM (Ubuntu 24.04, Linux 6.8), commit 4f5c52f.
Benchmarks 26
- Benchmark reports
Dated reports. Those written before 2026-10-07 use the names of that time: the server was called SCB (scb-webd, scbctl, crates scb-, result rows labelled scb); it is now Scale Web Server (ScalWS): scalwsd, scalwsctl, sca
- Benchmark harness
Reproducible, comparative HTTP benchmarks (handoff §14).
- Pre-Adaptive-Runtime baseline (frozen 2026-10-06)
The authoritative single-instance reference for the Adaptive Runtime work: regression gates compare against these numbers with Adaptive Runtime disabled.
- Release-mode comparison with nginx and OpenLiteSpeed, and soak: 2026-10-11
Machine and pinning as in 2026-10-10-xeon-bare-metal-pgo.md: 2× Xeon E5-2650 v2, server on four physical cores (CPUs 0-3), upstream and applications on 4-7, oha on socket 1; performance governor, turbo off. MODE=release:
- Bare metal (2× Xeon E5-2650 v2) and profile-guided builds: 2026-10-10
First measurements away from the noisy VM: 2× Xeon E5-2650 v2 (Ivy Bridge EP, 8C/16T per socket, no AVX2), 121 GB, Ubuntu 26.04, kernel 7.0, performance governor, turbo off. Server on CPUs 0-3 (four physical cores of soc
- Experimental upstream client vs hyper (2026-10-09)
ADR-0045. One scalwsd build (commit d7dcbf5, --features http3), run with server.upstreamclient: hyper (default) and experimental. Development VM: 4 server CPUs (0-3), upstreams on 4-5, load generator on 6-11. bench/multi
- Final comparison: scalws vs nginx 1.24 / 1.30.5 / 1.31.6 (2026-10-09)
Overnight work (2026-10-08/09): Stage 1 (upstream path), Stage 2 (upstream telemetry), the open items, then this comparison. Host and method as in 2026-10-08-nginx-versions-real-apps.md: 8 vCPU EPYC 7642 VM, server on CP
- Instructions per request (callgrind) and nginx comparison: 2026-10-09
The VM's throughput noise (CV 5–10 %) hides changes of a few percent, so user-space work per request was measured with callgrind: the server runs under valgrind --tool=callgrind, 500 warm-up requests, counters zeroed, 40
- Where scalws trailed nginx outside the proxy: causes (2026-10-09)
Follow-up to 2026-10-09-final-vs-nginx.md. Four areas were behind nginx 1.24–1.31.6 there: small static files (0.95–0.98×), 1 MiB files (0.95×), TLS + HTTP/2 (0.96–0.97×) and p99 tails (cache hits 9.2 ms vs 3.3–6.8 ms).
- QUIC demux: profile and batching experiment (rejected) (2026-10-08)
Host: development VM (8 vCPU EPYC 7642). 3 instances (CPUs 0-2), demux + controller on CPU 3, 4 × scalws-h3-probe (4 connections × 4 streams each, /hello.txt) on CPUs 4-7. bench/demux-profile.sh (perf + strace), bench/de
- Per-domain counters (ADR-0042): A/B gate (2026-10-08)
Host: development VM (8 vCPU EPYC 7642, Ubuntu 24.04). One binary (release, --features http3), two configurations: metrics.hosts: false (off, via bench/hosts-off-wrapper.sh, which adds the setting to the bench configurat
- scalws vs nginx 1.24 / 1.30.5 / 1.31.6, synthetic and real applications (2026-10-08)
Host: development VM (8 vCPU EPYC 7642, Ubuntu 24.04). Server on CPUs 0-3, applications and upstreams on 4-5 (MariaDB pinned there too), oha on 6-7. MODE=release RUNS=3 FRESHSERVER=1 (3 × 30 s per scenario after 10 s war
Decision records 47
- 0001 Rust + Tokio + hyper for the data plane
- 0002 rustls with the aws-lc-rs crypto provider
- 0003 Declarative YAML configuration, validate-then-swap
- 0004 Two-level runtime contract (Handler / RuntimeAdapter)
- 0005 Metrics, logs and bounded cardinality
- 0006 Static file confinement
All 47 decision records
- 0007 Linux-first product, cross-platform development
- 0008 Managed application processes
- 0009 PHP via FastCGI using the `fastcgi-client` crate
- 0010 cgroup v2 placement, tenant resource limits and request quotas
- 0011 Data-driven application profiles and detection
- 0012 Bounded in-memory response cache
- 0013 Deterministic security engine (first stage)
- 0014 Deterministic optimizer (policy engine)
- 0015 Deterministic diagnostics
- 0016 Local AI advisor
- 0017 Admin API and operations
- 0018 ACME certificate automation
- 0019 HTTP/3 (QUIC): experimental, behind a feature
- 0020 Container runtime adapter
- 0021 Multi-node control plane (design only)
- 0022 Trusted proxies (X-Forwarded-For, PROXY protocol)
- 0023 Remote administration over mutual TLS
- 0024 Disk tier of the response cache
- 0025 Optional eBPF enrichment: per-application network accounting
- 0026 Per-tenant Unix users for application processes
- 0027 Zero-copy static file bodies with sendfile(2)
- 0028 Open file cache for static files
- 0029 Per-core event loops
- 0030 Kernel TLS for HTTPS/1.1 file bodies (opt-in)
- 0031 `.htaccess` compatibility (opt-in per application)
- 0032 FastCGI connection drivers for managed PHP-FPM pools
- 0033 Adaptive Runtime: control plane, data plane and listener sharing
- 0034 PressureScore v1 and bottleneck classification
- 0035 Instance lifecycle, draining, configuration generations and recovery
- 0036 State with several scalwsd instances on one host
- 0037 Listener generations: listener changes without restarting the controller
- 0038 Connection distribution: measure pressure, not connection counts
- 0039 HTTP/3 with several instances: a separate QUIC transport plane
- 0040 QUIC connection IDs: routing and privacy
- 0041 HTTP/3 graceful lifecycle (single and multiple instances)
- 0042 Per-domain request counters
- 0043 Upstream connection telemetry
- 0044 Fountain accept policy (opt-in)
- 0045 Experimental own HTTP/1 upstream client (opt-in)
- 0046 Own HTTP/1 server side (opt-in)
- 0047 Profile-guided release builds