Longshore Rust I/O Library Hits 36 GB/s on Amazon S3

Dashboard of ServiceRadar, the platform that uses the Longshore Rust I/O library

Longshore Rust I/O is a new open-source layer for fast storage and network work, and its headline figure is 36.4 GB/s. That is the rate at which a single thread uploads to Amazon S3 on a Graviton4 machine whose network card runs at 300 Gbit/s. Add a CRC-64/NVME checksum to each body and the same thread manages 16.7 GB/s.

ServiceRadar wrote the library, about 25,000 lines of Rust, to sit under its video storage and its UltraGraphDB graph database. It is released under the Apache 2.0 license.

Why build a Longshore Rust I/O layer

ServiceRadar’s complaint about stock cloud storage SDKs is long: they block on DNS lookups, hide thread pools, allocate memory per request and copy buffers needlessly. By its estimate, ten times the available network and NVMe bandwidth goes to waste.

Instead of an async runtime, Longshore gives every core a plain thread and its own io_uring ring. The data path is lock-free, and the heap is filled once at startup.

Four design rules

  • One thread per core. A single completion queue serves that thread’s sockets, files, timers and wakeups from other cores.
  • Allocate once. Everything is reserved when the I/O object is built: buffers, file slots, socket tables, mailbox rings. A guard then locks the heap and panics on any later allocation.
  • Protocols as state machines. HTTP, DNS, TLS, S3 and consumer code submit operations tagged with 64-bit tokens and handle the completions that come back.
  • Cores talk through mailboxes. When one core needs another, it sends a bounded, fixed-size message through a lock-free queue.

What’s inside Longshore

Longshore also includes direct-I/O NVMe support with linked operations, so a write-ahead-log write and its fdatasync can go to the kernel in one submission. A simulated disk models whole-machine power loss, 4096-byte sector tearing and 11 disk faults, including bit flips. A portable backend runs on kqueue or epoll and passes the same contract tests as the Linux io_uring backend.

The S3 client talks to a dedicated ring through the mailbox. Concurrency is checked with loom: The client’s 10 model tests explore as many as 20,183 interleavings in 3.50 seconds, and the 17 mailbox tests finish in 0.35 seconds.

Benchmarks and caveats

The S3 tests ran from us-east-1 on two machines, a c8gn.24xlarge with Graviton4 and a 300 Gbit/s card, and an m8azn.24xlarge with AMD Zen 5 and a 200 Gbit/s card. Objects were 8 MiB, one client thread did the work, and each figure is the median over five runs of 8 seconds. Plain GET on the AMD machine reached 7.9 GB/s.

Against published figures for TigerBeetle’s Zig client, Longshore is ahead on plain and checksummed PUT on Graviton4 and a little slower on GET. On the AMD machine it leads on GET and checksummed PUT and trails on plain PUT.

The best numbers need an option that ships switched off. S3’s endpoint resolves to several addresses; some negotiate TCP segments of 8,228 bytes, others of 1,432. Neither card splits segments in hardware, so the small ones burn several times more client CPU per byte. Switched on, the client favors addresses with large segments. With it off, throughput depends on which addresses a run lands on.

On the smaller c8gn.8xlarge the 100 Gbit/s card is the ceiling. Plain PUT saturates it with 17% of one core, while HTTPS PUT sustains 3.94 GB/s. Across the cards tested, one thread reaches 96 to 97% of line rate. A 400 Gbit/s card hasn’t been tested.

Disks and TLS

For sequential direct I/O, Longshore wrote at 13.1 GB/s and read at 14.9 GB/s on the DGX Spark’s Samsung PM9E1, matching the drive’s rating. On an AWS i7i.4xlarge it matched fio at 3.7 GB/s writes and 4.9 GB/s reads. The write figure on the Spark may reflect the drive’s write cache and isn’t a sustained rate.

The write-plus-sync chain test is a correction story. An earlier write-up claimed a 23% median gain. That test always ran the two-submission mode first, and whichever runs first is slower. Once the order was corrected, the chain’s median latency was 11% lower in one Spark run and between 1 and 7% lower in three shorter ones. On AWS the two modes can’t be told apart.

Profiling TLS on the Spark showed Longshore’s own Rust code uses under 1% of CPU. About half the core goes to AWS-LC’s AES-GCM kernels (roughly 57% of PUT and 50% of GET), and most of the rest is Linux kernel TCP work. Pushing single-core TLS well past about 4.5 GB/s would take faster hardware-accelerated encryption or kernel and NIC offload.

Where it gets used next

Inside ServiceRadar, Longshore Rust I/O powers storage for video and for the topology engine. Specifically, Longshore streams video segments to local NVMe and S3-compatible stores on a fraction of a core, and it backs the topology engine’s UltraGraphDB with fault-injection testing. The code is on GitHub at carverauto/longshore. The open question is how it behaves on 400 Gbit/s cards, which the team hasn’t measured yet.

Source: ServiceRadar

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.