Skip to content
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

Configurable TCP server connection backlog #1952

Merged
merged 3 commits into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/v/config/configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ configuration::configuration()
required::no,
tls_config(),
tls_config::validate)
, rpc_server_listen_backlog(
*this,
"rpc_server_listen_backlog",
"TCP connection queue length for Kafka server and internal RPC server",
required::no,
std::nullopt)
, enable_coproc(
*this, "enable_coproc", "Enable coprocessing mode", required::no, false)
, coproc_supervisor_server(
Expand Down
1 change: 1 addition & 0 deletions src/v/config/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct configuration final : public config_store {
// Network
property<unresolved_address> rpc_server;
property<tls_config> rpc_server_tls;
property<std::optional<int>> rpc_server_listen_backlog;
// Coproc
property<bool> enable_coproc;
property<unresolved_address> coproc_supervisor_server;
Expand Down
4 changes: 4 additions & 0 deletions src/v/redpanda/application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@ void application::wire_up_redpanda_services() {
c.max_service_memory_per_core = memory_groups::rpc_total_memory();
c.disable_metrics = rpc::metrics_disabled(
config::shard_local_cfg().disable_metrics());
c.listen_backlog
= config::shard_local_cfg().rpc_server_listen_backlog;
auto rpc_builder = config::shard_local_cfg()
.rpc_server_tls()
.get_credentials_builder()
Expand Down Expand Up @@ -741,6 +743,8 @@ void application::wire_up_redpanda_services() {
return ss::async([this, &c] {
c.max_service_memory_per_core
= memory_groups::kafka_total_memory();
c.listen_backlog
= config::shard_local_cfg().rpc_server_listen_backlog;
auto& tls_config
= config::shard_local_cfg().kafka_api_tls.value();
for (const auto& ep : config::shard_local_cfg().kafka_api()) {
Expand Down
3 changes: 3 additions & 0 deletions src/v/rpc/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ void server::start() {
ss::listen_options lo;
lo.reuse_address = true;
lo.lba = cfg.load_balancing_algo;
if (cfg.listen_backlog.has_value()) {
lo.listen_backlog = cfg.listen_backlog.value();
}

if (!endpoint.credentials) {
ss = ss::engine().listen(endpoint.addr, lo);
Expand Down
1 change: 1 addition & 0 deletions src/v/rpc/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ struct server_endpoint {
struct server_configuration {
std::vector<server_endpoint> addrs;
int64_t max_service_memory_per_core;
std::optional<int> listen_backlog;
metrics_disabled disable_metrics = metrics_disabled::no;
ss::sstring name;
// we use the same default as seastar for load balancing algorithm
Expand Down