← Graph

UringMachine — High Performance Concurrency for Ruby Using io_uring

talk 20 connections

Sharon Rosner's wroclove.rb 2026 talk introducing UringMachine, his Ruby gem that combines fibers with Linux io_uring for concurrent IO. Covers: (1) Fibers — suspendable/resumable execution contexts, initially wired together with Fiber#transfer, evolving to a run-queue abstraction and a fiber_switch method; (2) IO-aware fiber switching — fibers register intent to perform IO and only when the run queue is empty does the scheduler block on IO.select; (3) io_uring — Linux-specific async IO interface with submission queue (SQ), completion queue (CQ), and user_data tagging; three-phase ops (submission, execution, completion); the io_uring_enter syscall wrapped by io_uring_submit; (4) Combining fibers with io_uring — a 'machine' is an io_uring instance plus a run queue, with fibers re-queued when their CQE arrives; (5) UringMachine features — low-level API over raw FDs + buffers, IO class with buffered reads, fiber scheduler implementation, cancellation via scheduling exceptions, universal timeouts, graceful shutdown via exceptions, multi-shot accept/timeout/read/receive, provided buffers with incremental consumption for fully automatic buffer management, segmented (linked-list) buffers to avoid copy/alloc, synchronization primitives built on futex (mutexes, queues), OpenSSL integration via a custom BIO (with a PR open on the OpenSSL gem competing with one from a maintainer), pidfd and inotify support; (6) Benchmark with 50 Unix pipe pairs showing threads vs async vs UringMachine fiber scheduler vs UringMachine low-level API — advantage grows with concurrency, but the scenario is synthetic and pure-IO. Caveat: real Rails apps are CPU-heavy (refers audience to Jean Boussier's 'The Mythical IO-Bound Rails App'). Current uses: proof-of-concept Rack server running Rails, Syntropy web framework, closed-source time-series platform, converting legacy EventMachine apps. Roadmap: IPv6, batch-processing DSL, HTTP/1, HTTP/2, PostgreSQL wire protocol (Redis protocol already works), and integration with Rails/Hanami/Sidekiq. Q&A covered backlog limits on multi-shot accept, not using Falcon, and the EventMachine-replacement motivation.

date
2026-04-17
type
talk
talk UringMachine — High Performance Concurrency for Ruby Using io_uring
about
UringMachine project
The talk introduces and explains UringMachine.
talk UringMachine — High Performance Concurrency for Ruby Using io_uring
about
io_uring concept
Explains the io_uring interface and its submission/completion model.
talk UringMachine — High Performance Concurrency for Ruby Using io_uring
about
Fiber concept
Explains fibers and fiber-based concurrency in Ruby.
talk UringMachine — High Performance Concurrency for Ruby Using io_uring
about
Run Queue concept
Introduces the run-queue abstraction to mediate fiber switching.
talk UringMachine — High Performance Concurrency for Ruby Using io_uring
about
Fiber Scheduler concept
Discusses Ruby's Fiber Scheduler interface and UringMachine's implementation of it.
talk UringMachine — High Performance Concurrency for Ruby Using io_uring
about
Explains io_uring provided buffers and incremental consumption.
talk UringMachine — High Performance Concurrency for Ruby Using io_uring
about
Discusses multi-shot accept/timeout/read/receive.
talk UringMachine — High Performance Concurrency for Ruby Using io_uring
about
Positions UringMachine as a modern replacement for unmaintained EventMachine.
talk UringMachine — High Performance Concurrency for Ruby Using io_uring
about
Polyphony project
Sharon mentions Polyphony as his earlier io_uring concurrency gem.
talk UringMachine — High Performance Concurrency for Ruby Using io_uring
about
async tool
Benchmarks compare UringMachine against the async fiber scheduler.
talk UringMachine — High Performance Concurrency for Ruby Using io_uring
about
Falcon tool
Mentions Falcon as Samuel Williams's async-based web server; Sharon does not use it.
asked_at
UringMachine — High Performance Concurrency for Ruby Using io_uring talk
Audience Q&A.
asked_at
UringMachine — High Performance Concurrency for Ruby Using io_uring talk
Audience Q&A.
asked_at
UringMachine — High Performance Concurrency for Ruby Using io_uring talk
Audience Q&A.
person Sharon Rosner
authored
UringMachine — High Performance Concurrency for Ruby Using io_uring talk
Sharon delivered this talk at wroclove.rb 2026.
from_talk
UringMachine — High Performance Concurrency for Ruby Using io_uring talk
Benchmark result presented by Sharon.
from_talk
UringMachine — High Performance Concurrency for Ruby Using io_uring talk
Sharon's caveat after showing the synthetic benchmark.
from_talk
UringMachine — High Performance Concurrency for Ruby Using io_uring talk
Expressed explicitly in the talk and Q&A.
from_talk
UringMachine — High Performance Concurrency for Ruby Using io_uring talk
Sharon explains the automatic buffer-management design.
talk UringMachine — High Performance Concurrency for Ruby Using io_uring
presented_at
Talk delivered at wroclove.rb 2026 on 2026-04-17.

Provenance

Created
2026-04-17 16:18 seed
Read by
25 extractions