diff --git a/flow/Knobs.cpp b/flow/Knobs.cpp index 98278d0bba..e6749f60d8 100644 --- a/flow/Knobs.cpp +++ b/flow/Knobs.cpp @@ -171,6 +171,7 @@ void FlowKnobs::initialize(Randomize randomize, IsSimulated isSimulated) { init( MIN_LOGGED_PRIORITY_BUSY_FRACTION, 0.05 ); init( CERT_FILE_MAX_SIZE, 5 * 1024 * 1024 ); init( READY_QUEUE_RESERVED_SIZE, 8192 ); + init( ITERATIONS_PER_REACTOR_CHECK, 5 ); //Network init( PACKET_LIMIT, 100LL<<20 ); diff --git a/flow/Knobs.h b/flow/Knobs.h index 0c84b0576b..f22ec4f0f1 100644 --- a/flow/Knobs.h +++ b/flow/Knobs.h @@ -226,6 +226,7 @@ public: double MIN_LOGGED_PRIORITY_BUSY_FRACTION; int CERT_FILE_MAX_SIZE; int READY_QUEUE_RESERVED_SIZE; + int ITERATIONS_PER_REACTOR_CHECK; // Network int64_t PACKET_LIMIT; diff --git a/flow/Net2.actor.cpp b/flow/Net2.actor.cpp index c902a0027d..2a26ce8b84 100644 --- a/flow/Net2.actor.cpp +++ b/flow/Net2.actor.cpp @@ -1533,8 +1533,8 @@ void Net2::run() { minTaskID = currentTaskID; } - // attempt to empty out the IO backlog for every 5 tasks while in this loop - if (ready.size() % 5 == 1) { + // attempt to empty out the IO backlog + if (ready.size() % FLOW_KNOBS->ITERATIONS_PER_REACTOR_CHECK == 1) { if (runFunc) { runFunc(); }