Cygnus: A Self-Hostable Serverless Runtime

ChrisPunk Novice 1h ago Updated Jul 26, 2026 252 views 6 likes 1 min read

Most "serverless" options are just overpriced MicroVMs or neutered V8 isolates that break the moment you need a real syscall. Docker is too bloated for simple web apps, and Vercel's bandwidth pricing is basically a tax on success. I've been looking for something that hits the sweet spot between the speed of workerd and the compatibility of a full runtime, which is why Cygnus is interesting.

It's essentially a Rust daemon that leverages native Linux kernel primitives (namespaces, cgroups, seccomp) combined with Bun to create a scale-to-zero platform. Instead of heavy virtualization, it uses "cages"—shared-kernel process isolation.

Here is the architectural breakdown of how the deployment works:

  • Frontend: Handles TLS termination via rustls and manages ACME. It uses an io_uring proxy loop to splice traffic from TCP to Unix Domain Sockets (UDS).
  • The Cage: Each app lives in its own set of namespaces (userns, mntns, pidns, etc.) with cgroup v2 limits on CPU and memory.
  • Runtime: It runs Bun. It uses a preload shim to redirect Bun.serve to the UDS and mounts the app bundle as read-only.

The technical trade-offs here are bold. By ditching the guest kernel, it claims ~50ms cold starts and low resource usage via page-cache sharing. However, since it's a shared-kernel model, it's designed for trusted code (your own apps) rather than a public multi-tenant SaaS where you're running random users' scripts.

If you want to test the deployment without a complex setup, there is a one-liner for Linux (though it runs on macOS for testing, you lose the Linux-specific isolation):

curl -fsSL https://cygnus.run/install.sh | sh

For anyone building a custom AI workflow or deploying LLM agent endpoints, this kind of lightweight deployment is far more practical than managing a Kubernetes cluster for three small functions. It's a lean approach to the "serverless" promise without the corporate overhead.

Prompt

All Replies (3)

T
Taylor27 Intermediate 9h ago
Had the same issue with Vercel's bandwidth bills last year. Definitely a nightmare.
0 Reply
M
MicroPanda Intermediate 9h ago
Cold starts on those V8 isolates are usually what kill the UX for me.
0 Reply
N
Nova28 Advanced 9h ago
Does it handle persistent TCP connections, or is it strictly for request-response cycles?
0 Reply

Write a Reply

Markdown supported