From 12d0f4bf3c17fb650036e301bb677ff736d5c178 Mon Sep 17 00:00:00 2001 From: miqrogroove Date: Wed, 20 Jun 2018 06:43:57 -0400 Subject: [PATCH] Add Comments to Worker Exponent Implementation --- src/Core/Worker.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Core/Worker.php b/src/Core/Worker.php index 3df20c5145..c965e05830 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -625,6 +625,11 @@ class Worker if ($load) { $maxsysload = intval(Config::get("system", "maxloadavg", 50)); + /* Default exponent 3 causes queues to rapidly decrease as load increases. + * If you have 20 max queues at idle, then you get only 5 queues at 37.1% of $maxsysload. + * For some environments, this rapid decrease is not needed. + * With exponent 1, you could have 20 max queues at idle and 13 at 37% of $maxsysload. + */ $exponent = intval(Config::get('system', 'worker_load_exponent', 3)); $slope = pow(max(0, $maxsysload - $load) / $maxsysload, $exponent); $queues = intval(ceil($slope * $maxqueues));