SlideShare a Scribd company logo
A ScyllaDB Community
Rust, io_uring, ktls:
How fast can we make HTTP?
Amos Wenger
writer, video producer, cat owner
bearcove
A ScyllaDB Community
Nobody in the Rust space is going
far enough with io_uring
(as far as I'm aware)
Amos Wenger
writer, video producer, cat owner
bearcove
Amos Wenger (they/them) aka @fasterthanlime
writer, video producer, cat owner
■ Wrote "Making our own executable packer"
■ Teaching Rust since 2019 with Cool Bear
■ Fan of TLS (thread-local storage & the other one)
bearcove
Rust + io_uring + ktls: How Fast Can We Make HTTP?
Rust + io_uring + ktls: How Fast Can We Make HTTP?
Define "HTTP"
Define "fast"
Rust HTTP is already fast
hyper on master is 📦 v1.4.1 via 🦀 v1.80.1
❯ gl --color=always | tail -5
Commit: 886551681629de812a87555bb4ecd41515e4dee6
Author: Sean McArthur <sean.monstar@gmail.com>
Date: 2014-08-30 14:18:28 -0700 (10 years ago)
init
HTTP/1.1 200 OK
Date: Fri, 31 Dec 1999 23:59:59 GMT
Content-Type: text/html
Content-Length: 1354
Rust + io_uring + ktls: How Fast Can We Make HTTP?
/// An HTTP status code (`status-code` in RFC 9110 et al.).
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct StatusCode(NonZeroU16);
mystery winner > itoa stack > itoa heap > std::fmt
criterion bench: format_status_code, avg µs
// A string of packed 3-ASCII-digit status code
// values for the supported range of [100, 999]
// (900 codes, 2700 bytes).
const CODE_DIGITS: &str = "
100101102103104105106107108109110
✂ ✂ ✂
989990991992993994995996997998999";
We're not bickering over
assembly anymore
My hypothesis
● spectre, meltdown, etc => mitigations
● mitigations => more expensive syscalls
● more expensive syscalls => io_uring
Type systems are hard
fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize>
fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize>
Lifetimes exist in every language
Rust merely explicits them
fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize>
blocking
fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize>
fn poll_read(
&mut self,
buf: &mut [u8],
) -> Poll<Result<usize>>
evented (O_NONBLOCK)
blocking
fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize>
fn poll_read(
&mut self,
buf: &mut [u8],
) -> Poll<Result<usize>>
evented (O_NONBLOCK)
blocking
fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize>
fn poll_read(
&mut self,
cx: &mut Context<'_>,
buf: &mut [u8],
) -> Poll<Result<usize>>
evented (O_NONBLOCK)
blocking
fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize>
fn poll_read(
&mut self,
cx: &mut Context<'_>,
buf: &mut ReadBuf<'_>,
) -> Poll<Result<usize>>
evented (O_NONBLOCK)
blocking
fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize>
fn poll_read(
&mut self,
cx: &mut Context<'_>,
buf: &mut ReadBuf<'_>,
) -> Poll<Result<()>>
evented (O_NONBLOCK)
blocking
fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize>
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut ReadBuf<'_>,
) -> Poll<Result<()>>
evented (O_NONBLOCK)
Rust + io_uring + ktls: How Fast Can We Make HTTP?
blocking
fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize>
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut ReadBuf<'_>,
) -> Poll<Result<()>>
evented (O_NONBLOCK)
fn read(
&mut self,
buf: &mut [u8]
) -> Read<'_, Self>
where Self: Unpin
async
blocking
fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize>
fn read(
&mut self,
buf: &mut [u8]
) -> Read<'_, Self>
where Self: Unpin
async
blocking
fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize>
async fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize>
where Self: Unpin { ... }
async
async fn mhh(mut s: TcpStream) -> io::Result<Vec<u8>> {
let mut buf = vec![0u8; 4];
s.read_exact(&mut buf).await?;
Ok(buf)
}
async stack trace
read(&mut [u8])
read_exact(&mut [u8])
mhhh()
// (not shown: tokio runtime internals)
real stack trace
Read::poll(Pin<&mut Read>, &mut Context<'_>)
ReadExact::poll(Pin<&mut ReadExact>, &mut Context<'_>)
Mhh::poll(Pin<&mut Mhh>, &mut Context<'_>)
// (not shown: tokio runtime internals)
async fn mhh(mut s: TcpStream) -> io::Result<Vec<u8>> {
let mut buf = vec![0u8; 4];
tokio::select! {
result = s.read_exact(&mut buf) => {
result?;
Ok(buf)
}
_ = sleep(Duration::from_secs(1)) => {
Err(timeout_err())
}
}
}
async fn mhh(mut s: TcpStream) -> io::Result<Vec<u8>> {
let mut buf = vec![0u8; 4];
tokio::select! {
result = s.read_exact(&mut buf) => {
result?;
Ok(buf)
}
_ = sleep(Duration::from_secs(1)) => {
Err(timeout_err())
}
}
}
rio::Uring
pub fn recv<'a, Fd, Buf>(
&'a self,
stream: &'a Fd,
iov: &'a Buf
) -> Completion<'a, usize>
rio::Uring
impl<'a, C: FromCqe> Drop
for Completion<'a, C> {
fn drop(&mut self) {
self.wait_inner();
}
}
let mut buf = vec![0u8; 4];
let mut read_fut = Box::pin(s.read_exact(&mut buf));
tokio::select! {
_ = &mut read_fut => { todo!() }
_ = sleep(Duration::from_secs(1)) => {
std::mem::forget(read_fut);
Err(timeout_err())
}
}
Rust + io_uring + ktls: How Fast Can We Make HTTP?
Rust + io_uring + ktls: How Fast Can We Make HTTP?
tokio_uring::net::TcpStream
async fn read(&self, buf: T) -> (T, Result<usize>)
where T: BoundedBufMut;
Fine, I'll rewrite everything
on top of io-uring then.
docs.rs/loona
Rust + io_uring + ktls: How Fast Can We Make HTTP?
load testing is hard
■ macOS = nice for dev, useless for perf
■ P-states
■ love your noisy neighbors
■ stats are hard (coordinated omission etc.)
the plan?
■ Intel(R) Xeon(R) CPU E3-1275 v6 @ 3.80GHz
■ h2load from another dedicated server
■ 16 clients virtual clients, max 100 streams per
client
■ python for automation (running commands over
SSH, CSV => XLS etc.)
■ perf for counting cycles, instructions, branches
Rust + io_uring + ktls: How Fast Can We Make HTTP?
Rust + io_uring + ktls: How Fast Can We Make HTTP?
what's next?
● more/better benchmarks
● …on hardware from this decade
● proxying to HTTP/1.1, serving from disk
● messing with: allocators, buffer size
● io_uring: provided buffers, multishot accept/read
● move off of tokio entirely (no atomics needed, no "write to
unpark thread" needed)
how do we make that happen?
● money donations
● hardware donations
● expertise donations
● did I mention money
Thank you! Let’s connect.
Amos Wenger
amos@bearcove.net
@fasterthanlime
https://fasterthanli.me
bearcove

More Related Content

Similar to Rust + io_uring + ktls: How Fast Can We Make HTTP? (20)

PDF
The JSON Architecture - BucharestJS / July
Constantin Dumitrescu
 
PDF
Storm Anatomy
Eiichiro Uchiumi
 
RTF
Useful linux-commands
Himani Singh
 
ODP
What Shazam doesn't want you to know
Roy van Rijn
 
DOCX
assign4assign4_part1bonnie.c This is a file system ben.docx
festockton
 
PPT
Real-Time Python Web: Gevent and Socket.io
Rick Copeland
 
PDF
Of Owls and IO Objects
Felix Morgner
 
PDF
Webscraping with asyncio
Jose Manuel Ortega Candel
 
PDF
Rust LDN 24 7 19 Oxidising the Command Line
Matt Provost
 
PDF
swift-nio のアーキテクチャーと RxHttpClient
Shinya Mochida
 
PDF
Степан Кольцов — Rust — лучше, чем C++
Yandex
 
PDF
Netty from the trenches
Jordi Gerona
 
PDF
Masters bioinfo 2013-11-14-15
Yannick Wurm
 
PDF
The Power of CSS
Aniket Pant
 
PDF
How deep is your buffer – Demystifying buffers and application performance
Cumulus Networks
 
PDF
Go Concurrency
Cloudflare
 
PPT
INTRODUCTION TO SOCKETS IN COMPUTER NETWORKS DEPT OF CSE.ppt
senthilnathans25
 
TXT
Tic tac toe
jo pakson
 
PDF
FPBrno 2018-05-22: Benchmarking in elixir
Functional Programming Brno
 
PDF
mod_perl 2.0 For Speed Freaks!
Philippe M. Chiasson
 
The JSON Architecture - BucharestJS / July
Constantin Dumitrescu
 
Storm Anatomy
Eiichiro Uchiumi
 
Useful linux-commands
Himani Singh
 
What Shazam doesn't want you to know
Roy van Rijn
 
assign4assign4_part1bonnie.c This is a file system ben.docx
festockton
 
Real-Time Python Web: Gevent and Socket.io
Rick Copeland
 
Of Owls and IO Objects
Felix Morgner
 
Webscraping with asyncio
Jose Manuel Ortega Candel
 
Rust LDN 24 7 19 Oxidising the Command Line
Matt Provost
 
swift-nio のアーキテクチャーと RxHttpClient
Shinya Mochida
 
Степан Кольцов — Rust — лучше, чем C++
Yandex
 
Netty from the trenches
Jordi Gerona
 
Masters bioinfo 2013-11-14-15
Yannick Wurm
 
The Power of CSS
Aniket Pant
 
How deep is your buffer – Demystifying buffers and application performance
Cumulus Networks
 
Go Concurrency
Cloudflare
 
INTRODUCTION TO SOCKETS IN COMPUTER NETWORKS DEPT OF CSE.ppt
senthilnathans25
 
Tic tac toe
jo pakson
 
FPBrno 2018-05-22: Benchmarking in elixir
Functional Programming Brno
 
mod_perl 2.0 For Speed Freaks!
Philippe M. Chiasson
 

More from ScyllaDB (20)

PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
PDF
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
PDF
New Ways to Reduce Database Costs with ScyllaDB
ScyllaDB
 
PDF
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
PDF
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
ScyllaDB
 
PDF
Leading a High-Stakes Database Migration
ScyllaDB
 
PDF
Achieving Extreme Scale with ScyllaDB: Tips & Tradeoffs
ScyllaDB
 
PDF
Securely Serving Millions of Boot Artifacts a Day by João Pedro Lima & Matt ...
ScyllaDB
 
PDF
How Agoda Scaled 50x Throughput with ScyllaDB by Worakarn Isaratham
ScyllaDB
 
PDF
How Yieldmo Cut Database Costs and Cloud Dependencies Fast by Todd Coleman
ScyllaDB
 
PDF
ScyllaDB: 10 Years and Beyond by Dor Laor
ScyllaDB
 
PDF
Reduce Your Cloud Spend with ScyllaDB by Tzach Livyatan
ScyllaDB
 
PDF
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
ScyllaDB
 
PDF
Vector Search with ScyllaDB by Szymon Wasik
ScyllaDB
 
PDF
Workload Prioritization: How to Balance Multiple Workloads in a Cluster by Fe...
ScyllaDB
 
PDF
Two Leading Approaches to Data Virtualization, and Which Scales Better? by Da...
ScyllaDB
 
PDF
Scaling a Beast: Lessons from 400x Growth in a High-Stakes Financial System b...
ScyllaDB
 
PDF
Object Storage in ScyllaDB by Ran Regev, ScyllaDB
ScyllaDB
 
PDF
Lessons Learned from Building a Serverless Notifications System by Srushith R...
ScyllaDB
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
New Ways to Reduce Database Costs with ScyllaDB
ScyllaDB
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
ScyllaDB
 
Leading a High-Stakes Database Migration
ScyllaDB
 
Achieving Extreme Scale with ScyllaDB: Tips & Tradeoffs
ScyllaDB
 
Securely Serving Millions of Boot Artifacts a Day by João Pedro Lima & Matt ...
ScyllaDB
 
How Agoda Scaled 50x Throughput with ScyllaDB by Worakarn Isaratham
ScyllaDB
 
How Yieldmo Cut Database Costs and Cloud Dependencies Fast by Todd Coleman
ScyllaDB
 
ScyllaDB: 10 Years and Beyond by Dor Laor
ScyllaDB
 
Reduce Your Cloud Spend with ScyllaDB by Tzach Livyatan
ScyllaDB
 
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
ScyllaDB
 
Vector Search with ScyllaDB by Szymon Wasik
ScyllaDB
 
Workload Prioritization: How to Balance Multiple Workloads in a Cluster by Fe...
ScyllaDB
 
Two Leading Approaches to Data Virtualization, and Which Scales Better? by Da...
ScyllaDB
 
Scaling a Beast: Lessons from 400x Growth in a High-Stakes Financial System b...
ScyllaDB
 
Object Storage in ScyllaDB by Ran Regev, ScyllaDB
ScyllaDB
 
Lessons Learned from Building a Serverless Notifications System by Srushith R...
ScyllaDB
 
Ad

Recently uploaded (20)

PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
The Future of Artificial Intelligence (AI)
Mukul
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Ad

Rust + io_uring + ktls: How Fast Can We Make HTTP?

  • 1. A ScyllaDB Community Rust, io_uring, ktls: How fast can we make HTTP? Amos Wenger writer, video producer, cat owner bearcove
  • 2. A ScyllaDB Community Nobody in the Rust space is going far enough with io_uring (as far as I'm aware) Amos Wenger writer, video producer, cat owner bearcove
  • 3. Amos Wenger (they/them) aka @fasterthanlime writer, video producer, cat owner ■ Wrote "Making our own executable packer" ■ Teaching Rust since 2019 with Cool Bear ■ Fan of TLS (thread-local storage & the other one) bearcove
  • 8. Rust HTTP is already fast
  • 9. hyper on master is 📦 v1.4.1 via 🦀 v1.80.1 ❯ gl --color=always | tail -5 Commit: 886551681629de812a87555bb4ecd41515e4dee6 Author: Sean McArthur <[email protected]> Date: 2014-08-30 14:18:28 -0700 (10 years ago) init
  • 10. HTTP/1.1 200 OK Date: Fri, 31 Dec 1999 23:59:59 GMT Content-Type: text/html Content-Length: 1354
  • 12. /// An HTTP status code (`status-code` in RFC 9110 et al.). #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct StatusCode(NonZeroU16);
  • 13. mystery winner > itoa stack > itoa heap > std::fmt criterion bench: format_status_code, avg µs
  • 14. // A string of packed 3-ASCII-digit status code // values for the supported range of [100, 999] // (900 codes, 2700 bytes). const CODE_DIGITS: &str = " 100101102103104105106107108109110 ✂ ✂ ✂ 989990991992993994995996997998999";
  • 15. We're not bickering over assembly anymore
  • 16. My hypothesis ● spectre, meltdown, etc => mitigations ● mitigations => more expensive syscalls ● more expensive syscalls => io_uring
  • 18. fn read( &mut self, buf: &mut [u8], ) -> Result<usize>
  • 19. fn read( &mut self, buf: &mut [u8], ) -> Result<usize>
  • 20. Lifetimes exist in every language Rust merely explicits them
  • 21. fn read( &mut self, buf: &mut [u8], ) -> Result<usize>
  • 22. blocking fn read( &mut self, buf: &mut [u8], ) -> Result<usize> fn poll_read( &mut self, buf: &mut [u8], ) -> Poll<Result<usize>> evented (O_NONBLOCK)
  • 23. blocking fn read( &mut self, buf: &mut [u8], ) -> Result<usize> fn poll_read( &mut self, buf: &mut [u8], ) -> Poll<Result<usize>> evented (O_NONBLOCK)
  • 24. blocking fn read( &mut self, buf: &mut [u8], ) -> Result<usize> fn poll_read( &mut self, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<usize>> evented (O_NONBLOCK)
  • 25. blocking fn read( &mut self, buf: &mut [u8], ) -> Result<usize> fn poll_read( &mut self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>, ) -> Poll<Result<usize>> evented (O_NONBLOCK)
  • 26. blocking fn read( &mut self, buf: &mut [u8], ) -> Result<usize> fn poll_read( &mut self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>, ) -> Poll<Result<()>> evented (O_NONBLOCK)
  • 27. blocking fn read( &mut self, buf: &mut [u8], ) -> Result<usize> fn poll_read( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>, ) -> Poll<Result<()>> evented (O_NONBLOCK)
  • 29. blocking fn read( &mut self, buf: &mut [u8], ) -> Result<usize> fn poll_read( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>, ) -> Poll<Result<()>> evented (O_NONBLOCK) fn read( &mut self, buf: &mut [u8] ) -> Read<'_, Self> where Self: Unpin async
  • 30. blocking fn read( &mut self, buf: &mut [u8], ) -> Result<usize> fn read( &mut self, buf: &mut [u8] ) -> Read<'_, Self> where Self: Unpin async
  • 31. blocking fn read( &mut self, buf: &mut [u8], ) -> Result<usize> async fn read( &mut self, buf: &mut [u8], ) -> Result<usize> where Self: Unpin { ... } async
  • 32. async fn mhh(mut s: TcpStream) -> io::Result<Vec<u8>> { let mut buf = vec![0u8; 4]; s.read_exact(&mut buf).await?; Ok(buf) }
  • 33. async stack trace read(&mut [u8]) read_exact(&mut [u8]) mhhh() // (not shown: tokio runtime internals)
  • 34. real stack trace Read::poll(Pin<&mut Read>, &mut Context<'_>) ReadExact::poll(Pin<&mut ReadExact>, &mut Context<'_>) Mhh::poll(Pin<&mut Mhh>, &mut Context<'_>) // (not shown: tokio runtime internals)
  • 35. async fn mhh(mut s: TcpStream) -> io::Result<Vec<u8>> { let mut buf = vec![0u8; 4]; tokio::select! { result = s.read_exact(&mut buf) => { result?; Ok(buf) } _ = sleep(Duration::from_secs(1)) => { Err(timeout_err()) } } }
  • 36. async fn mhh(mut s: TcpStream) -> io::Result<Vec<u8>> { let mut buf = vec![0u8; 4]; tokio::select! { result = s.read_exact(&mut buf) => { result?; Ok(buf) } _ = sleep(Duration::from_secs(1)) => { Err(timeout_err()) } } }
  • 37. rio::Uring pub fn recv<'a, Fd, Buf>( &'a self, stream: &'a Fd, iov: &'a Buf ) -> Completion<'a, usize>
  • 38. rio::Uring impl<'a, C: FromCqe> Drop for Completion<'a, C> { fn drop(&mut self) { self.wait_inner(); } }
  • 39. let mut buf = vec![0u8; 4]; let mut read_fut = Box::pin(s.read_exact(&mut buf)); tokio::select! { _ = &mut read_fut => { todo!() } _ = sleep(Duration::from_secs(1)) => { std::mem::forget(read_fut); Err(timeout_err()) } }
  • 42. tokio_uring::net::TcpStream async fn read(&self, buf: T) -> (T, Result<usize>) where T: BoundedBufMut;
  • 43. Fine, I'll rewrite everything on top of io-uring then. docs.rs/loona
  • 45. load testing is hard ■ macOS = nice for dev, useless for perf ■ P-states ■ love your noisy neighbors ■ stats are hard (coordinated omission etc.)
  • 46. the plan? ■ Intel(R) Xeon(R) CPU E3-1275 v6 @ 3.80GHz ■ h2load from another dedicated server ■ 16 clients virtual clients, max 100 streams per client ■ python for automation (running commands over SSH, CSV => XLS etc.) ■ perf for counting cycles, instructions, branches
  • 49. what's next? ● more/better benchmarks ● …on hardware from this decade ● proxying to HTTP/1.1, serving from disk ● messing with: allocators, buffer size ● io_uring: provided buffers, multishot accept/read ● move off of tokio entirely (no atomics needed, no "write to unpark thread" needed)
  • 50. how do we make that happen? ● money donations ● hardware donations ● expertise donations ● did I mention money
  • 51. Thank you! Let’s connect. Amos Wenger [email protected] @fasterthanlime https://fasterthanli.me bearcove