-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Process kafka requests in a separate scheduling group #24973
Conversation
CI test resultstest results on build#61350
test results on build#61495
|
@@ -682,6 +684,10 @@ connection_context::dispatch_method_once(request_header hdr, size_t size) { | |||
? std::make_optional<ss::sstring>(*hdr.client_id) | |||
: std::nullopt, | |||
}; | |||
|
|||
co_await ss::coroutine::switch_to( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@travisdowns related to the discussion from yesterday, does this even allocate the coroutine frame if await_ready
returns true (because we are already in the right group - ignoring for a second whether we actually are here or not)? I thought not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which coroutine do you refer to? In any case there shouldn't be a coroutine frame allocated per switch_to, whether the switch happens or not. What await_ready
returning true does is avoids an unnecessary task switch (which is probably more expensive even than a coro frame in "micro" costs, and certainly in macro costs as it breaks out of the current executing request, etc).
/** | ||
* Scheduling group to process requests received via the REST API of | ||
* admin server. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love to see these comments, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good pending moving the SG definition into the handler.
Added property allowing us to control if `kafka` scheduling group should be used to handle parsing and handling Kafka API requests. Signed-off-by: Michał Maślanka <[email protected]>
Signed-off-by: Michał Maślanka <[email protected]>
Signed-off-by: Michał Maślanka <[email protected]>
Added code that allows handler to control the scheduling group they are processed in. If a handler returns no override then the handler runs in a default `kafka` scheduling group. Signed-off-by: Michał Maślanka <[email protected]>
b587cfc
44c7696
to
b587cfc
Compare
Added code that allows using separate scheduling group for Kafka
requests processing. The scheduling group can be switched based on the
API type. By default processing is done in the group returned by
kafka::server::get_request_handler_sg
Backports Required
Release Notes