diff --git a/config.toml b/config.toml index b61344f..6556a33 100644 --- a/config.toml +++ b/config.toml @@ -7,8 +7,8 @@ port = 8080 max_request_size_bytes = 1048576 # 1MB # Number of accept threads for handling incoming connections accept_threads = 1 -# Number of network I/O threads for epoll processing (0 = use hardware concurrency) -network_threads = 0 +# Number of network I/O threads for epoll processing +network_threads = 1 # Event batch size for epoll processing event_batch_size = 32 diff --git a/src/config.hpp b/src/config.hpp index 15c0085..3864224 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -19,7 +19,7 @@ struct ServerConfig { /// Number of accept threads for handling incoming connections int accept_threads = 1; /// Number of network I/O threads for epoll processing - int network_threads = 0; // 0 means use hardware_concurrency + int network_threads = 1; /// Event batch size for epoll processing int event_batch_size = 32; }; diff --git a/src/main.cpp b/src/main.cpp index 57fc10b..f8f474d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -234,7 +234,7 @@ int main(int argc, char *argv[]) { << " bytes" << std::endl; std::cout << "Accept threads: " << config->server.accept_threads << std::endl; std::cout << "Network threads: " << config->server.network_threads - << " (0 = auto)" << std::endl; + << std::endl; std::cout << "Event batch size: " << config->server.event_batch_size << std::endl; std::cout << "Min request ID length: " << config->commit.min_request_id_length @@ -262,14 +262,8 @@ int main(int argc, char *argv[]) { abort(); } - // Network threads - use config value, fallback to hardware concurrency + // Network threads from configuration int networkThreads = config->server.network_threads; - if (networkThreads == 0) { - // TODO revisit - networkThreads = std::thread::hardware_concurrency(); - if (networkThreads == 0) - networkThreads = 1; // ultimate fallback - } // Event batch size from configuration for (int i = 0; i < networkThreads; ++i) {