Use at most 7 client threads on OpenBSD to stay within default limit of 128 file descriptors.
This commit is contained in:
parent
d6a9c509ab
commit
f7588582cd
@ -429,7 +429,11 @@ class MultiImplPool {
|
||||
if (impls_.empty()) {
|
||||
init_openssl_threads();
|
||||
|
||||
impls_.resize(clamp(thread::hardware_concurrency(), 8u, 20u) * 5 / 4);
|
||||
auto max_client_threads = clamp(thread::hardware_concurrency(), 8u, 20u) * 5 / 4;
|
||||
#if TD_OPENBSD
|
||||
max_client_threads = td::min(max_client_threads, 7u);
|
||||
#endif
|
||||
impls_.resize(max_client_threads);
|
||||
CHECK(impls_.size() * (1 + MultiImpl::ADDITIONAL_THREAD_COUNT + 1 /* IOCP */) < 128);
|
||||
|
||||
net_query_stats_ = std::make_shared<NetQueryStats>();
|
||||
|
@ -868,7 +868,7 @@ TEST(Client, Simple) {
|
||||
}
|
||||
|
||||
TEST(Client, SimpleMulti) {
|
||||
std::vector<td::Client> clients(40);
|
||||
std::vector<td::Client> clients(7);
|
||||
//for (auto &client : clients) {
|
||||
//client.execute({1, td::td_api::make_object<td::td_api::setLogTagVerbosityLevel>("td_requests", 1)});
|
||||
//}
|
||||
|
Loading…
Reference in New Issue
Block a user