Configurable read buffer size

This commit is contained in:
2025-08-19 12:20:56 -04:00
parent 2b458747f8
commit 91dcf04635
4 changed files with 86 additions and 10 deletions

View File

@@ -86,6 +86,7 @@ void ConfigParser::parse_server_config(const auto &toml_data,
parse_field(srv, "network_threads", config.network_threads);
parse_field(srv, "event_batch_size", config.event_batch_size);
parse_field(srv, "max_connections", config.max_connections);
parse_field(srv, "read_buffer_size", config.read_buffer_size);
});
}
@@ -165,6 +166,14 @@ bool ConfigParser::validate_config(const Config &config) {
valid = false;
}
if (config.server.read_buffer_size < 1024 ||
config.server.read_buffer_size > 1024 * 1024) { // 1KB to 1MB
std::cerr << "Configuration error: server.read_buffer_size must be between "
"1024 and 1048576 bytes, got "
<< config.server.read_buffer_size << std::endl;
valid = false;
}
// Validate commit configuration
if (config.commit.min_request_id_length < 8 ||
config.commit.min_request_id_length > 256) {