Skip to content

Commit

Permalink
Add CLI arguments for io_uring request batch size and timeout
Browse files Browse the repository at this point in the history
Summary:
This diff adds two new io_uring flags for Memcache:
* `io_uring_timeout`
* `io_uring_batch_size`

These will be used later on in this stack for configuring the changes to the Thrift IoUringBackend.

Reviewed By: udippant

Differential Revision: D50900747

fbshipit-source-id: b192bb233e1292c0c90584251ba398f188bc50eb
  • Loading branch information
spikeh authored and facebook-github-bot committed Nov 9, 2023
1 parent 39e6e13 commit 485ba07
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions folly/experimental/io/IoUringBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ class IoUringBackend : public EventBaseBackendBase {
return *this;
}

Options& setTimeout(int v) {
timeout = v;

return *this;
}

Options& setBatchSize(int v) {
batchSize = v;

return *this;
}

size_t capacity{256};
size_t minCapacity{0};
size_t maxSubmit{128};
Expand All @@ -185,6 +197,13 @@ class IoUringBackend : public EventBaseBackendBase {
uint32_t flags{0};
bool taskRunCoop{false};
bool deferTaskRun{false};
// Maximum amount of time to wait (in microseconds) per io_uring_enter
// Both timeout _and_ batchSize must be set for io_uring_enter wait_nr to be
// set!
int timeout{0};
// Minimum number of requests (defined as sockets with data to read) to wait
// for per io_uring_enter
int batchSize{0};

std::chrono::milliseconds sqIdle{0};
std::chrono::milliseconds cqIdle{0};
Expand Down

0 comments on commit 485ba07

Please sign in to comment.