io_uring moves I/O submission and completion off the syscall path and into two shared-memory ring buffers, which means a benchmark that only counts syscalls will misrepresent it badly. On a virtual machine the situation is more interesting than on bare metal: the guest kernel can batch and poll on your side of the hypervisor boundary, but the virtio queue in the middle sets the real ceiling. This article shows how to measure submission-queue throughput against libaio and plain synchronous I/O on the same VPS, and how to read the numbers without fooling yourself.
What the ring actually saves you
With synchronous reads, each 4 KB operation costs a read() syscall, a context switch into the kernel, and a return. libaio reduces that with a batched io_submit(), but it still enters the kernel once per batch and requires O_DIRECT. io_uring uses two memory-mapped rings: userspace writes submission entries and reads completion entries without a syscall at all when the kernel is polling.
The saving is per-operation overhead, so the benefit scales with IOPS and shrinks when the device itself is the limit. On a 200 µs-latency network volume, shaving 2 µs of syscall time changes nothing. On fast local NVMe with high queue depth, the syscall cost becomes a visible fraction of the total and the batching pays. Measure first; do not assume.
Check kernel support and permission before benchmarking
Verify the kernel exposes the ring: uname -r should be 5.10 or later for a mature implementation, and cat /proc/sys/kernel/io_uring_disabled should print 0. Some hardened images and container runtimes set it to 1 or 2, which disables the interface entirely; that is a common reason a benchmark “fails” on a managed image.
Install a tool that speaks io_uring natively. fio --enghelp lists io_uring and io_uring_cmd when built against liburing. If your distribution’s fio lacks the engine, build it with ./configure --enable-liburing. Also confirm the runtime user has memlock headroom: the ring buffers are locked pages, so a low ulimit -l produces an ENOMEM at ring creation with a misleading message.
The three-engine comparison, held constant
Use one job file per engine with identical block size, queue depth, file size and runtime. The comparison below runs 4k random reads at iodepth 32 with four jobs over a 2 GB direct-access file:
fio --name=t --rw=randread --bs=4k --iodepth=32 --numjobs=4 --size=2G --direct=1 --time_based --runtime=60 --ioengine=sync- same flags with
--ioengine=libaio(requires direct I/O) - same flags with
--ioengine=io_uring, then again with--hiprito enable polling
Run each three times, drop the first run to warm metadata, and record IOPS, mean clat and clat p99. Keep the server otherwise idle and confirm with vmstat 1 that no other process is generating I/O during the window.
Reading the results honestly
Expect sync I/O to be dominated by syscall overhead at this queue depth, typically yielding a fraction of the async engines’ IOPS. libaio and io_uring often land close together on a virtio disk because the hypervisor queue, not the syscall path, is the constraint. A large gap in io_uring’s favour on a VPS usually means the provider gives you real local NVMe with a fast backend.
The --hipri run is where numbers diverge most. Polling burns a CPU per polling thread and can double apparent IOPS while raising guest CPU to 100 percent. That trade is worth it for a latency-sensitive service on a dedicated host and wasteful on a 2-vCPU plan where the poller starves your application. Report both figures; the polled number alone is marketing.
Watch the guest CPU cost alongside the IOPS
Every engine claims the device with less overhead; the test is whether total CPU time per I/O falls. Sample pidstat -u -p $(pgrep fio) 1 during each run, or run fio with --cpuclock-test and --write_bw_log to capture per-job statistics. Divide CPU seconds by completed I/Os to get microseconds per operation, which is comparable across engines even when IOPS differ.
Also check /proc/interrupts before and after each run to see whether virtio completion interrupts rise linearly with IOPS or whether they flatline because polling replaced them. A rising %sys in vmstat with flat IOPS tells you the guest is the bottleneck and io_uring is unlikely to help further.
Where io_uring does not help on a VPS
Single-threaded web servers doing buffered reads gain little. The page cache already amortises most syscall cost, and io_uring’s advantages show up with direct I/O, high queue depth, or many concurrent small operations. Databases with their own async I/O layer (PostgreSQL with io_uring support, MySQL with native AIO) may already be doing this, so duplicating it at the application level adds complexity for nothing.
Network operations through io_uring need kernel 5.19 or later for many socket paths and are still evolving; on a VPS the virtio-net queue and your provider’s egress shaping usually dominate. Profile with perf stat -e context-switches,cycles,instructions on your real workload before rewriting anything. If context switches are already low, the ring has nothing to remove.
A repeatable harness you can rerun after upgrades
Wrap the comparison in a script that writes one JSON line per run with engine, IOPS, p99 latency, CPU seconds and kernel version. Rerun it after each provider change or plan resize and diff the file. Trends across months say more about a host than any single benchmark, especially when providers quietly move volumes between storage arrays.
Keep the working set larger than RAM so page cache cannot mask the device, and pin the number of jobs to your vCPU count for the application-representative run. For plan tiers and disk classes to test against, our VPS comparison table lists what each tier advertises, and the plan breakdown notes which ones use local NVMe rather than network storage. Test both if you can; the io_uring gain only appears on the former.



Leave a Reply
You must be logged in to post a comment.