You can build a Rust web server in two ways. The synchronous design uses one OS thread per connection. The asynchronous design, built on Tokio, runs many requests on a few threads. Many people assume async is always faster, but measurements show it is not. At low concurrency, sync code uses less CPU and memory for a single request. Async keeps memory flat as concurrency climbs, but it uses more CPU time and adds complexity. Neither style wins in every situation. The right choice depends on how many concurrent requests your service actually handles.
Sync means a thread blocks while waiting for I/O, holding that thread for the whole request. Async means a task yields when it waits for I/O, so the runtime can run other tasks on the same thread until the I/O completes.
How the two styles behave under load
A sync server gives each incoming connection its own OS thread. When the thread reads from a socket or a file, the OS suspends it until data arrives. The thread stays occupied for the entire request, even while it waits. Each thread has its own stack and kernel structures, so memory grows roughly with the number of concurrent connections. As Rust forum user alice put it in the original thread on this subject, synchronous code can perform a task faster when it monopolizes a whole thread, but asynchronous code scales much better as the number of concurrent tasks grows, because it handles a very large number of tasks on only a few threads.
An async server built on Tokio keeps a small pool of threads, usually one per CPU core. When a request waits on I/O, the task yields and the runtime schedules another task onto that thread. One thread can therefore handle thousands of concurrent connections. That sharing of threads is what Tokio’s scheduler provides, and it is the core reason async exists in Rust at all. The cost is bookkeeping: the runtime tracks task states, schedules work, and each I/O operation passes through its machinery. That overhead is small per operation, but it adds up.
The practical difference shows up in two resources: memory and CPU. Sync spends a predictable chunk of memory per concurrent connection and relatively little CPU per request. Async spends a fixed amount of memory that does not grow with connections, but more CPU overall because the runtime does more work to multiplex everything.
What a direct measurement shows
In that same Rust forum thread, user viktor_h ran a series of tests comparing a sync file server with two async implementations built on Hyper and Tokio. First came a one-shot operation: reading a large file took longer asynchronously than synchronously. For a single task with no concurrency, the async overhead is pure loss.
Then came the web server tests with 20, 100, and 250 concurrent requests. The sync version served each request on its own thread; the two async versions used a codec::FramedRead stream and a custom Stream implementation respectively. Peak resident memory (RSS) shows the difference:
| Concurrent requests | Sync peak RSS | Async (codec) peak RSS | Async (custom stream) peak RSS |
|---|---|---|---|
| 20 | 17 MB | 24 MB | 27 MB |
| 100 | 71 MB | 27 MB | 28 MB |
| 250 | 162 MB | 74 MB | 29 MB |
At 20 concurrent requests, sync used the least memory. By 100, the async versions had pulled ahead, and at 250 the gap was stark: 162 MB for sync versus 29 MB for the custom stream implementation. The sync server’s memory grew roughly with concurrency, as the thread-per-connection design requires. The async versions paid a different cost: at 100 requests, sync used 1:04 of CPU time while the async versions used 2:49 and 3:27. At 250 requests, sync used 2:59 versus 6:51 and 8:28 for async.
Two other behaviors from that test matter for capacity planning. In the async runs, memory consumption jumped immediately to the maximum and stayed there, while the sync server’s RSS moved around with load. And at 250 requests, the custom async stream kept its peak memory practically unchanged, only requests got slower. That is the sign of a memory-bounded design: the async server absorbs more concurrency into the same footprint and degrades gracefully.
The benchmark has limits. It came from one developer’s machine, likely Linux, with one workload, and the numbers give a general sense rather than exact values. But the shape of the tradeoff, memory per connection versus CPU overhead, is structural to the two designs, so it holds across hardware.
The decision rule for your server
Start with the concurrency your service actually sees. If your server regularly handles hundreds or thousands of simultaneous connections, use async. The memory gap at 250 concurrent requests grows with every additional connection, because each sync connection costs a full thread stack and kernel state. A sync server that handles a modest number of connections comfortably can exhaust memory as concurrency grows.
If your service rarely exceeds a few dozen concurrent connections, sync is the simpler choice, and the memory advantage of async is small or reversed. A low-traffic API, an internal tool, or a service where requests arrive slowly all fit this pattern. Sync code is also the better fit for CPU-bound work: the async runtime adds overhead that does nothing for a task that just computes. If you do run an async server and some requests are CPU-heavy, run that work with spawn_blocking so it does not hold a runtime thread and stall other requests.
The workload matters as much as the concurrency. Async runtimes earn their overhead on I/O-bound work like web servers, proxies, real-time communication, and database drivers. For workloads that spend their time waiting on the network or disk, a few threads multiplexing thousands of connections beat thousands of threads. For workloads that spend their time in tight loops, threads win.
Within the async world, framework choice matters less than the async-versus-sync decision. In a comparison of Hyper and Actix Web on an Apple Silicon Mac running 5 million requests at concurrency levels from 25 to 300, neither framework was a clear winner and both used similar resources. The big structural choice is async versus sync, not which async crate you import.
The real cost of async is complexity
The performance numbers understate what async actually costs, because the harder-to-measure expense is development. Async Rust is harder to write than sync Rust. You compose futures, the borrow checker applies differently across await points, and certain tools are known traps. A Tokio author warned against FuturesUnordered unless you know all its pitfalls, and noted that Tokio’s cooperative preemption can have side effects on other futures when one future multiplexes several. These failure modes do not exist in a simple sync server. If you are new to how Tokio implements async/await, budget time for the learning curve before you commit to it.
Async does buy one thing beyond raw scaling. In the forum tests, Hyper provided backpressure management for free: in a limited-rate download test, the Rust servers did not leave large file chunks resident in memory. The server slows delivery to the client instead of buffering whole responses in RAM. That keeps memory predictable under load, which is part of why the async memory stayed flat.
Measure with your own workload
The forum numbers come from one developer’s benchmark, so treat them as a general guide, not a guarantee. Run your own test with your actual request pattern before you decide. Set the concurrency level your service expects, measure peak RSS and total CPU time, not just p95 latency, and raise concurrency until you see where memory breaks. A sync server that looks fine in a smoke test can fail at the concurrency your production traffic actually generates. The same test will show you whether the async CPU overhead matters at your request rate or is a price you never notice.