From a0c350a76e79b4a9a0605ed1426cb2eca807ddd8 Mon Sep 17 00:00:00 2001 From: Erin Power Date: Tue, 22 Oct 2024 16:23:00 +0200 Subject: [PATCH] perf: Queue up CPU * 32 recvs --- src/components/proxy/io_uring_shared.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/proxy/io_uring_shared.rs b/src/components/proxy/io_uring_shared.rs index b9b28eb44b..3ac7bcecb9 100644 --- a/src/components/proxy/io_uring_shared.rs +++ b/src/components/proxy/io_uring_shared.rs @@ -592,7 +592,12 @@ impl IoUringLoop { tokens, }; - loop_ctx.enqueue_recv(buffer_pool.clone().alloc()); + // Queue a number of recv's to hopefully reduce the number of + // syscalls between data. + for _ in 0..(num_cpus::get() * 32) { + loop_ctx.enqueue_recv(buffer_pool.clone().alloc()); + } + loop_ctx .push_with_token(pending_sends_event.io_uring_entry(), Token::PendingsSends); loop_ctx.push_with_token(shutdown_event.io_uring_entry(), Token::Shutdown);