Experimental io-uring support landed in latest actix-files beta.
The latest actix-files beta has received experimental support for Linux's io-uring, enabling truly async filesystem access.
In our early benchmarks, we're seeing 25% improvement in throughput when serving static files and this should have positive effects on resource usage, too. If you're using Actix Web to serve static files from a Linux machine with a recent kernel, this could be free performance win for you; no code changes necessary.
It's a semver-exempt feature for now, though; so don't be alarmed if it breaks without a major version bump. See actix-files changelog →
Early benchmark on a 4-core machine with a 25Mb file:
tokio::fs (sync thread-pool)
$ wrk -c100 -t4 -d10s http://localhost:8080/big-file
Running 10s test @ http://localhost:8080/big-file
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.43s 332.34ms 2.00s 63.51%
Req/Sec 24.16 17.88 100.00 76.76%
657 requests in 10.02s, 16.76GB read
Socket errors: connect 0, read 0, write 0, timeout 13
Requests/sec: 65.59
Transfer/sec: 1.67GB
io-uring (tokio_uring)
$ wrk -c100 -t4 -d10s http://localhost:8080/big-file
Running 10s test @ http://localhost:8080/big-file
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.13s 224.73ms 1.71s 66.79%
Req/Sec 35.49 29.28 151.00 78.81%
825 requests in 10.08s, 21.84GB read
Requests/sec: 81.82
Transfer/sec: 2.17GB