Skip to content

fix (WMS): keep the OptimizationMind fast during large job backlogs - #8889

Open
chrisburr wants to merge 6 commits into
DIRACGrid:integrationfrom
chrisburr:fix/optimizationmind-loadjobs-set
Open

chrisburr wants to merge 6 commits into
DIRACGrid:integrationfrom
chrisburr:fix/optimizationmind-loadjobs-set

Conversation

@chrisburr

@chrisburr chrisburr commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Fixes for the OptimizationMind found while ~1M jobs were stuck in Received at LHCb (Received → Waiting fell to ~3 jobs/s):

  • Look up known tasks in a set in __loadJobs: checking each loaded job against the getTaskIds() list took ~82% of the Mind's CPU.
  • One job load at a time, and LoadJobPeriod now defaults to 60 s (it was 60 s for the first load, then 300 s, which capped a backlog at ~33 jobs/s).
  • Optional MaxHoldTime for JobScheduling: the hold time of a job held repeatedly doubles up to this value. It defaults to HoldTime, so nothing changes unless it is set.
  • Less contention on diraccfg's global lock: cache Registry.getHostnameForDN, and insert jobs into the TaskQueueDB from the manifest the Mind already has instead of parsing the JDL again.

BEGINRELEASENOTES
*WorkloadManagement
FIX: OptimizationMind no longer spends most of its CPU checking whether jobs are already known when loading jobs from the JobDB
FIX: OptimizationMind never runs two job loads at once
CHANGE: OptimizationMind loads jobs from the JobDB every 60s by default (LoadJobPeriod)
NEW: JobScheduling MaxHoldTime option to back off exponentially when the same job is held repeatedly
FIX: OptimizationMind no longer reads and parses the job JDL again when inserting a job into the TaskQueueDB
*Configuration
FIX: Registry.getHostnameForDN is cached, as getUsernameForDN already was
ENDRELEASENOTES

@chrisburr chrisburr changed the title fix (WMS): look up known tasks in a set when the OptimizationMind loads jobs fix (WMS): keep the OptimizationMind fast during large job backlogs Nov 14, 2026
@chrisburr
chrisburr force-pushed the fix/optimizationmind-loadjobs-set branch from 0b57801 to 146cb81 Compare November 14, 2026 22:12
…e fixture returns

pylint does not know that gConfig.getValue is replaced with a mock in the
test, and reports call_count as an unknown member.
@chrisburr
chrisburr marked this pull request as ready for review November 16, 2026 14:44
fstagni
fstagni previously approved these changes Nov 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants