Justify epoll_instances config existing
This commit is contained in:
@@ -85,11 +85,10 @@ void ConfigParser::parse_server_config(const auto &toml_data,
|
||||
parse_field(srv, "max_request_size_bytes", config.max_request_size_bytes);
|
||||
parse_field(srv, "io_threads", config.io_threads);
|
||||
|
||||
// Set epoll_instances default to io_threads/2 (min 1) if not explicitly
|
||||
// configured
|
||||
// Set epoll_instances default to io_threads if not explicitly configured
|
||||
bool epoll_instances_specified = srv.contains("epoll_instances");
|
||||
if (!epoll_instances_specified) {
|
||||
config.epoll_instances = std::max(1, config.io_threads / 2);
|
||||
config.epoll_instances = config.io_threads;
|
||||
} else {
|
||||
parse_field(srv, "epoll_instances", config.epoll_instances);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ struct ServerConfig {
|
||||
/// Number of I/O threads for handling connections and network events
|
||||
int io_threads = 1;
|
||||
/// Number of epoll instances to reduce epoll_ctl contention (default:
|
||||
/// io_threads/2, max: io_threads)
|
||||
int epoll_instances = 2;
|
||||
/// io_threads, max: io_threads)
|
||||
int epoll_instances = 1;
|
||||
/// Event batch size for epoll processing
|
||||
int event_batch_size = 32;
|
||||
/// Maximum number of concurrent connections (0 = unlimited)
|
||||
|
||||
Reference in New Issue
Block a user