$idle_workers = $active;
+ if (empty($deferred) && empty($entries)) {
+ $deferred = self::deferredEntries();
+ $entries = max(self::totalEntries() - $deferred, 0);
+ }
+
+ $waiting_processes = max(0, $entries - $deferred);
+
if (Config::get('system', 'worker_debug')) {
+ $waiting_processes = 0;
// Now adding all processes with workerqueue entries
$stamp = (float)microtime(true);
$jobs = DBA::p("SELECT COUNT(*) AS `entries`, `priority` FROM `workerqueue` WHERE NOT `done` AND `next_try` < ? GROUP BY `priority`", DateTimeFormat::utcNow());
self::$db_duration_stat += (microtime(true) - $stamp);
if ($process = DBA::fetch($processes)) {
$idle_workers -= $process["running"];
+ $waiting_processes += $entry["entries"];
$listitem[$entry["priority"]] = $entry["priority"].":".$process["running"]."/".$entry["entries"];
}
DBA::close($processes);
$processlist .= ' ('.implode(', ', $listitem).')';
- if (empty($deferred) && empty($entries)) {
- $deferred = self::deferredEntries();
- $entries = max(self::totalEntries() - $deferred, 0);
- }
-
if (Config::get("system", "worker_fastlane", false) && ($queues > 0) && self::entriesExists() && ($active >= $queues)) {
$top_priority = self::highestPriority();
$high_running = self::processWithPriorityActive($top_priority);
}
}
- Logger::log("Load: " . $load ."/" . $maxsysload . " - processes: " . $deferred . "/" . $active . "/" . ($entries - $deferred) . $processlist . " - maximum: " . $queues . "/" . $maxqueues, Logger::DEBUG);
+ Logger::log("Load: " . $load ."/" . $maxsysload . " - processes: " . $deferred . "/" . $active . "/" . $waiting_processes . $processlist . " - maximum: " . $queues . "/" . $maxqueues, Logger::DEBUG);
// Are there fewer workers running as possible? Then fork a new one.
if (!Config::get("system", "worker_dont_fork", false) && ($queues > ($active + 1)) && ($entries > 1)) {