Commit b628ea47 authored by Dominik Charousset's avatar Dominik Charousset

Limit number of BASP workers to 1-4 by default

parent 15a0b49f
...@@ -56,8 +56,9 @@ manual-multiplexing=false ...@@ -56,8 +56,9 @@ manual-multiplexing=false
disable-tcp=false disable-tcp=false
; enable communication via UDP ; enable communication via UDP
enable-udp=false enable-udp=false
; configures how many background workers are spawned for deserialization ; configures how many background workers are spawned for deserialization,
workers=<number of cores / 4> ; by default CAF uses 1-4 workers depending on the number of cores
workers=<max(3, number of cores / 4) + 1>
; when compiling with logging enabled ; when compiling with logging enabled
[logger] [logger]
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#include <limits> #include <limits>
#include <thread> #include <thread>
using std::max;
namespace { namespace {
using us_t = std::chrono::microseconds; using us_t = std::chrono::microseconds;
...@@ -54,7 +56,7 @@ namespace scheduler { ...@@ -54,7 +56,7 @@ namespace scheduler {
const atom_value policy = atom("stealing"); const atom_value policy = atom("stealing");
string_view profiling_output_file = ""; string_view profiling_output_file = "";
const size_t max_threads = std::max(std::thread::hardware_concurrency(), 4u); const size_t max_threads = max(std::thread::hardware_concurrency(), 4u);
const size_t max_throughput = std::numeric_limits<size_t>::max(); const size_t max_throughput = std::numeric_limits<size_t>::max();
const timespan profiling_resolution = ms(100); const timespan profiling_resolution = ms(100);
...@@ -92,7 +94,7 @@ const size_t max_consecutive_reads = 50; ...@@ -92,7 +94,7 @@ const size_t max_consecutive_reads = 50;
const size_t heartbeat_interval = 0; const size_t heartbeat_interval = 0;
const size_t cached_udp_buffers = 10; const size_t cached_udp_buffers = 10;
const size_t max_pending_msgs = 10; const size_t max_pending_msgs = 10;
const size_t workers = std::thread::hardware_concurrency() / 4; const size_t workers = max(3u, std::thread::hardware_concurrency() / 4u) + 1;
} // namespace middleman } // namespace middleman
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment