Skip to content

Commit

Permalink
bp/UringGlue: limit io_uring workers to 64+64
Browse files Browse the repository at this point in the history
These numbers have been tested on a machine with 96 CPU cores.
  • Loading branch information
MaxKellermann committed Jan 27, 2025
1 parent ec14133 commit 3ff90b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cm4all-beng-proxy (19.3) unstable; urgency=low
* bp: remove delegate support
* io_uring: handle EAGAIN to full pipe
* io_uring: add settings "io_uring_sqpoll", "io_uring_sq_thread_cpu"
* io_uring: limit io_uring workers to 64+64
* do not resolve IPv6 scope ids to interface names

--
Expand Down
11 changes: 11 additions & 0 deletions src/bp/UringGlue.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ UringGlue::UringGlue([[maybe_unused]] EventLoop &event_loop,
fprintf(stderr, "Failed to initialize io_uring: ");
PrintException(std::current_exception());
}

try {
/* limit the number of io_uring worker threads; having
too many only leads to lock contention inside the
kernel */
// TODO make configurable?
uring->SetMaxWorkers(64, 64);
} catch (...) {
fprintf(stderr, "Failed to set up io_uring: ");
PrintException(std::current_exception());
}
#endif
}

Expand Down

0 comments on commit 3ff90b3

Please sign in to comment.