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

@@ -7,8 +7,8 @@ port = 8080
max_request_size_bytes = 1048576 # 1MB max_request_size_bytes = 1048576 # 1MB
# Number of accept threads for handling incoming connections # Number of accept threads for handling incoming connections
accept_threads = 1 accept_threads = 1
# Number of network I/O threads for epoll processing (0 = use hardware concurrency) # Number of network I/O threads for epoll processing
network_threads = 0 network_threads = 1
# Event batch size for epoll processing # Event batch size for epoll processing
event_batch_size = 32 event_batch_size = 32

View File

@@ -19,7 +19,7 @@ struct ServerConfig {
/// Number of accept threads for handling incoming connections /// Number of accept threads for handling incoming connections
int accept_threads = 1; int accept_threads = 1;
/// Number of network I/O threads for epoll processing /// 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 /// Event batch size for epoll processing
int event_batch_size = 32; int event_batch_size = 32;
}; };

View File

@@ -234,7 +234,7 @@ int main(int argc, char *argv[]) {
<< " bytes" << std::endl; << " bytes" << std::endl;
std::cout << "Accept threads: " << config->server.accept_threads << std::endl; std::cout << "Accept threads: " << config->server.accept_threads << std::endl;
std::cout << "Network threads: " << config->server.network_threads 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::cout << "Event batch size: " << config->server.event_batch_size
<< std::endl; << std::endl;
std::cout << "Min request ID length: " << config->commit.min_request_id_length std::cout << "Min request ID length: " << config->commit.min_request_id_length
@@ -262,14 +262,8 @@ int main(int argc, char *argv[]) {
abort(); abort();
} }
// Network threads - use config value, fallback to hardware concurrency // Network threads from configuration
int networkThreads = config->server.network_threads; 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 // Event batch size from configuration
for (int i = 0; i < networkThreads; ++i) { for (int i = 0; i < networkThreads; ++i) {