diff --git a/src/v/config/configuration.cc b/src/v/config/configuration.cc index 5b9a461d2bc2..f5cdfef3e6f1 100644 --- a/src/v/config/configuration.cc +++ b/src/v/config/configuration.cc @@ -517,6 +517,12 @@ configuration::configuration() "Maximum number of bytes returned in fetch request", {.needs_restart = needs_restart::no, .visibility = visibility::user}, 55_MiB) + , use_fetch_scheduler_group( + *this, + "use_fetch_scheduler_group", + "Use a separate scheduler group for fetch processing", + {.needs_restart = needs_restart::no, .visibility = visibility::tunable}, + true) , metadata_status_wait_timeout_ms( *this, "metadata_status_wait_timeout_ms", diff --git a/src/v/config/configuration.h b/src/v/config/configuration.h index d8005941a050..31c21906606f 100644 --- a/src/v/config/configuration.h +++ b/src/v/config/configuration.h @@ -120,6 +120,7 @@ struct configuration final : public config_store { enum_property log_message_timestamp_type; enum_property log_compression_type; property fetch_max_bytes; + property use_fetch_scheduler_group; property metadata_status_wait_timeout_ms; bounded_property> kafka_connection_rate_limit; property> kafka_connection_rate_limit_overrides; diff --git a/src/v/kafka/server/server.cc b/src/v/kafka/server/server.cc index a37da6568c2a..c130676ddfa4 100644 --- a/src/v/kafka/server/server.cc +++ b/src/v/kafka/server/server.cc @@ -136,6 +136,12 @@ server::server( _probe.setup_public_metrics(); } +ss::scheduling_group server::fetch_scheduling_group() const { + return config::shard_local_cfg().use_fetch_scheduler_group() + ? _fetch_scheduling_group + : ss::default_scheduling_group(); +} + coordinator_ntp_mapper& server::coordinator_mapper() { return _group_router.local().coordinator_mapper().local(); } diff --git a/src/v/kafka/server/server.h b/src/v/kafka/server/server.h index d97bc0eca10d..e36c2cdf828e 100644 --- a/src/v/kafka/server/server.h +++ b/src/v/kafka/server/server.h @@ -73,9 +73,16 @@ class server final : public net::server { ss::future<> apply(ss::lw_shared_ptr) final; ss::smp_service_group smp_group() const { return _smp_group; } - ss::scheduling_group fetch_scheduling_group() const { - return _fetch_scheduling_group; - } + + /** + * @brief Return the scheduling group to use for fetch requests. + * + * By default, fetches use a dedicated scheduling group, but this may + * be changed by configuration to restore the old behavior of lumping + * them with most other tasks in the default scheduling group. + */ + ss::scheduling_group fetch_scheduling_group() const; + cluster::topics_frontend& topics_frontend() { return _topics_frontend.local(); }