Claviron
Retire middlemen. Let the others go!
Claviron is an application-first toolkit for building and running services. Run Rust alongside your existing applications. Keep them together as a modular monolith or distribute them across independent processes.
Build your own Edge and serve public traffic directly. Terminate TLS, route requests, serve files, and dispatch to your applications at the Edge. Your application controls every layer, from listeners and access rules to handlers and response policies. Enable what you need. An omitted layer adds no work per request.
Fleet awareness
Taste the power of Orbit. Let your processes share memory, exchange requests, and publish events on the same host. Orbit's shared-memory waits use Linux futexes, FreeBSD umtx, and shared address waits on macOS 14.4 and later.
Move to Rust without a full rewrite
Keep your application behind Claviron and add a Rust intercept for the first route you want to move. Claviron runs the Rust handler first. Requests it leaves unhandled continue to the existing application. You can move one API, a hot path, or a security check at a time while keeping the public URL and host policies.
Start with a route that benefits from Rust's type and memory safety, or one where you want to reduce latency or CPU use. Claviron can run the new Rust code alongside your PHP, Python, JavaScript, Go, Java, or C/C++ application. Each part can keep its existing runtime and move on its own schedule.
Design contracts
- Role composition · Hot pipeline · Edge backends
- Early data · Connection hijack · Lifetime policy
- Graceful ownership · Hot client pool · Worker adoption · Incarnation masking
- Fleet awareness · Orbit Cell · Orbit Link · Link Invoke
- Production environment · All design contracts
Build your own Edge
Add claviron with the edge and supervisor features and Tokio with
macros and rt-multi-thread. Define your listeners and hosts in config/.
use ;
async
Start with the Edge example or the Edge configuration guide.
Add ACME certificate automation and gRPC administration with typed service registration. DNS plugs into the same lifecycle through its registration function. Use compatible releases of the three backend crates and enable their server features.
use ;
use AcmeProvider as AcmeService;
use GrpcServiceProvider as GrpcAdmin;
async
ACME · gRPC administration · DNS · Runnable examples
Bring your application
- Rust — Serve an Axum or Warp application with Claviron Runner, or add reusable backends and layers to your Edge.
- PHP — Embed PHP or use FastCGI. Run Laravel with Lumenize or Symfony with Skene.
- Python — Run FastAPI and other ASGI applications with Gufi.
- JavaScript, Go, Java, and C/C++ — Use the native bindings to connect an application to Claviron over Orbit Link. Browse runnable examples.
Put boundaries where they belong
Let your Edge apply CORS and verify CSRF before a request reaches PHP. Claviron includes CORS policy. Register a route extension for CSRF and give it the application's session and token verifier. The Edge can then enforce the check on the routes you select.
routes:
/account:
csrf: true
Serve static files at the Edge
Mount asset directories, serve directory indexes, and configure try_files
or an SPA fallback. Large files stream from disk with backpressure. Small
files can be cached in memory and shared across workers when the fleet cache
is enabled.
| Capability | HTTP specification |
|---|---|
| ETag and Last-Modified, conditional requests, and single byte ranges | RFC 9110 §§8.8, 13–14 |
| Browser freshness via Cache-Control and Expires, with opt-in immutable assets | RFC 9111 §5, RFC 8246 |
| Negotiated Brotli and Zstandard representations | RFC 9110 §12.5, RFC 7932, RFC 8878 |
Static file configuration and caching
Performance
Plain HTTP. At the highest load all three configurations passed in the same Linux HTTP/1.1 run, Claviron with Axum delivered 3.27× Caddy's throughput with 68% less server CPU per response.
| Server | Responses/s | CPU/response |
|---|---|---|
| Caddy 2.11.9 | 268,817 | 74.76 µs |
| Claviron + Axum, 32 workers | 879,753 | 24.09 µs |
A separate run reached 1,045,500 responses/s with Claviron and Warp. Matched Caddy comparison · Warp peak
Persistent PHP. With 128 PHP instances and 1,024 connections, both servers completed the five-minute runs without errors. Each cell shows responses per second and server CPU per response.
| Workload | Claviron | FrankenPHP 1.13.5 |
|---|---|---|
| Plain PHP | 299,896 / 64.72 µs | 90,015 / 227.23 µs |
| Symfony, with Skene on Claviron | 88,139 / 312.43 µs | 41,398 / 565.52 µs |
FrankenPHP comparison · Laravel/Lumenize results
Near-native throughput with managed workers
On Linux with 1,024 HTTP/1.1 connections, Claviron Other delivered 93% of native Hyper's throughput at the highest load both passed. Its 40 supervised worker processes kept meeting the SLA up to 38,912 outstanding requests.
| Server | Responses/s at 16,384 outstanding | Server CPU/response | Last passing outstanding target |
|---|---|---|---|
| Native Hyper, 40 runtime threads | 1,811,355 | 14.50 µs | 16,384 |
| Claviron Other, 40 worker processes | 1,678,101 | 16.31 µs | 38,912 |
HTTP/1.1 benchmark and methodology
With Claviron for Apple, see embedded and linked applications together and add workers from the same app.
Crates.io · API documentation · Contributing · Security
Examples · Bench HTTP · Break
Licensed under MIT or Apache 2.0.