Running 15 million web servers on a single VM with userland networking
A technical experiment demonstrates how to host 15 million web servers on one VM by bypassing kernel overhead with smoltcp, DPDK, and custom scheduling.
A recent technical deep dive explores the limits of high-density networking by attempting to run 15 million web servers on a single virtual machine. The experiment, published in November 2026, targets a constrained environment of 10GB RAM and one CPU core to challenge traditional infrastructure assumptions. By moving network stack operations out of the kernel and into user space, the author achieves massive concurrency without proportional resource consumption.
What happened
The project began with a simple goal: create a unique web server for every person on Earth. Initial attempts using standard Linux system calls failed quickly. A basic C server listening on ports exhausted the available port range, which is limited to roughly 65,000 entries per IP address. Even after expanding the local port range and utilizing multiple IP addresses via AnyIP routing, the process hit a hard memory wall. Each standard socket created by the kernel consumes approximately 3300 bytes of RAM for internal structures like tcp_sock and socket_alloc, regardless of whether the connection is active or idle. Running millions of these sockets would require terabytes of memory, far exceeding the 10GB budget.
To overcome this, the approach shifted from relying on the operating system’s network stack to building a custom userland runtime. Instead of spawning millions of processes or threads, the solution uses a single process that hosts millions of lightweight guest contexts. This method mimics how virtual machines or language runtimes manage isolation but strips away all non-essential overhead. The key insight was that most connections remain idle, so their state should consume near-zero memory until data actually arrives.
How it works
The core technology relies on bypassing the kernel entirely for network I/O. Standard syscalls like listen and accept are replaced by a user-space TCP/IP stack called smoltcp. This library is designed for bare-metal systems and requires no heap allocation, making it ideal for tight memory constraints. To feed packets into this stack, the system uses high-performance interfaces like DPDK (Data Plane Development Kit) or AF_XDP. These tools allow the application to read Ethernet frames directly from the network card, skipping the kernel’s networking layers completely.
Scheduling is handled by a custom micro-kernel within the application. Each web server instance is represented by a minimal context structure containing only the program counter and two file descriptors, totaling just 16 bytes per guest. The CPU switches between these guests rapidly, resuming execution only when a packet arrives for a specific connection. Active connections consume about 5KB of RAM for buffer management, but idle connections cost nothing beyond their 16-byte context. This architecture allows 15 million idle servers to fit comfortably within the memory limit, with headroom for millions of simultaneous active connections.
Key details
- Target density: 15 million web servers on a single VM with 10GB RAM and 1 CPU core.
- Kernel overhead: Standard Linux sockets consume ~3300 bytes each due to structs like
tcp_sockanddentry, making them unsuitable for massive scale. - Userland stack: The project uses
smoltcp, a no-heap-allocation TCP/IP stack written in Rust, to handle protocol logic in user space. - I/O bypass: DPDK and AF_XDP are used to move packet processing out of the kernel, reducing latency and CPU context-switching costs.
- Memory efficiency: Idle connections use only 16 bytes for context storage, while active connections use approximately 5KB.
- Addressing: AnyIP routing allows the server to listen on entire subnets, providing enough unique IP addresses to distinguish millions of services.
Why it matters
For infrastructure engineers and technical founders, this experiment highlights the hidden costs of abstractions. Most modern web frameworks assume abundant memory and rely heavily on the OS kernel for connection management. While convenient, this model breaks down at extreme scales where per-connection overhead becomes the primary bottleneck. Understanding how to bypass the kernel reveals opportunities for optimizing high-throughput systems, such as load balancers, API gateways, and IoT hubs, where connection counts dwarf active traffic.
The shift toward userland networking is not new, with projects like Seastar and gVisor paving the way, but this demonstration simplifies the concept for practical application. It shows that with careful state management and the right tools, developers can achieve densities previously thought impossible on commodity hardware. This knowledge is crucial for building cost-effective cloud services and understanding the trade-offs between convenience and performance in distributed systems.
What you can do
- Evaluate your current network stack for per-connection memory overhead using tools like
ssornetstatcombined with memory profilers. - Experiment with
smoltcpor similar userland stacks for high-concurrency components like proxies or message brokers. - Investigate DPDK or AF_XDP if your application handles millions of packets per second and suffers from kernel interrupt overhead.
- Design protocols that minimize state for idle connections, allowing you to scale listener counts without linear memory growth.
- Use AnyIP or similar routing features to expand available address space without adding physical network interfaces.
- Profile context-switching costs in multi-threaded applications and consider cooperative scheduling models for high-density tasks.


