mirror of
https://github.com/friendica/friendica
synced 2024-11-13 00:22:59 +00:00
Add Comments to Worker Exponent Implementation
This commit is contained in:
parent
3f69568365
commit
12d0f4bf3c
1 changed files with 5 additions and 0 deletions
|
@ -625,6 +625,11 @@ class Worker
|
||||||
if ($load) {
|
if ($load) {
|
||||||
$maxsysload = intval(Config::get("system", "maxloadavg", 50));
|
$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));
|
$exponent = intval(Config::get('system', 'worker_load_exponent', 3));
|
||||||
$slope = pow(max(0, $maxsysload - $load) / $maxsysload, $exponent);
|
$slope = pow(max(0, $maxsysload - $load) / $maxsysload, $exponent);
|
||||||
$queues = intval(ceil($slope * $maxqueues));
|
$queues = intval(ceil($slope * $maxqueues));
|
||||||
|
|
Loading…
Reference in a new issue