View Issue Details

IDProjectCategoryView StatusLast Update
5656Composrcorepublic2024-07-23 16:56
ReporterPDStig Assigned ToPDStig  
PrioritynormalSeverityfeature 
Status resolvedResolutionfixed 
Summary5656: Optimise task queue more intelligently
DescriptionDue 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.
TagsRoadmap: v11
Attach Tags
Time estimation (hours)
Sponsorship open

Sponsor

Date Added Member Amount Sponsored

Relationships

related to 3958 Not AssignedGuest Opportunistic scheduler 
related to 5586 AssignedPDStig Task queue: Cron does not respect number of locked tasks; maybe it should 

Activities

PDStig

2024-04-14 23:50

administrator   ~8593

I decided on 10 seconds or 3,900 total database queries so far for the Cron run

PDStig

2024-07-23 16:55

administrator   ~8896

Last edited: 2024-07-23 16:56

Ideally this method should be replaced by 3958 in the future; this is a good temporary solution IMO until we can code in the more complex one. The major drawback is this one just runs tasks in hook order, so higher hooks have higher priority.

Issue History

Date Modified Username Field Change
2024-03-30 23:57 PDStig New Issue
2024-03-30 23:57 PDStig Status Not Assigned => Assigned
2024-03-30 23:57 PDStig Assigned To => user4172
2024-03-30 23:57 PDStig Tag Attached: Roadmap: v11
2024-04-12 19:00 PDStig Status Assigned => Resolved
2024-04-12 19:00 PDStig Resolution open => fixed
2024-04-14 23:50 PDStig Note Added: 0008593
2024-07-23 14:57 Chris Graham Relationship added related to 3958
2024-07-23 15:03 Chris Graham Relationship added related to 5586
2024-07-23 16:55 PDStig Note Added: 0008896
2024-07-23 16:55 PDStig Note Edited: 0008896
2024-07-23 16:56 PDStig Note Edited: 0008896