Remove auto network thread thing

This commit is contained in:
2025-08-18 14:08:30 -04:00
parent 78e3845130
commit 8e00e636b7
3 changed files with 5 additions and 11 deletions

View File

@@ -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;
};

View File

@@ -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) {