#5656 - Optimise task queue more intelligently

  • By
  • Added
  • 2 views
Identifier #5656
Issue type Feature request or suggestion
Title Optimise task queue more intelligently
Status Completed
Tags

Roadmap: v11 (custom)

Handling member PDStig
Addon core
Description Due to a memory issue if the task queue got populated too much, I implemented a temporary fix by limiting to 50 tasks per Cron cycle.

Let's make this more intelligent because not every task demands the same resources as other tasks, so we could intelligently fluctuate the number of tasks we run on a cycle depending on what tasks there are to run.

Let's track time. Process each task one at a time instead of locking a set number of tasks at once. After each task finishes, check how much time we spent so far processing background tasks. Once we reach, say, 15 seconds, then stop there for this Cron cycle. We could make this a config option as well for specifying how long to spend max on the task queue for each Cron cycle.
Steps to reproduce

Related to

#3958 - Opportunistic scheduler

Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated