Remove auto network thread thing
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
};
|
};
|
||||||
|
|||||||
10
src/main.cpp
10
src/main.cpp
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user