Server Info’s slowest-jobs refresh gets expensive as job history grows
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 18/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- database, performance
Direzione di ricerca
The slow query joins job_runs with job_classes_registry during the Slowest jobs refresh, run via php occ serverinfo:update-job-statistics. Measure the query on a large fixture before changing it, and compare results with the proposed grouped-by-class version. Work is already under way in PR #1292, so review or build on that branch rather than starting a parallel fix.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Server Info periodically refreshes the Slowest jobs summary. The refresh joins every retained job run with the job-class registry before calculating per-class statistics.
On instances with a large job history, this repeats the same class lookup hundreds of thousands of times.
I observed this in the MariaDB slow query log on two installations (yes I have two nextcloud instances) running Nextcloud 35.0.x, Server Info 7.0.0, and MariaDB 10.11.14.
| Instance | Query time | Rows examined |
|---|---|---|
| Main instance | 411–531 ms | Up to 630,000 |
| Second instance | 267–317 ms | Up to 420,000 |
Steps to reproduce
- On a test instance with a large retained job history, run
php occ serverinfo:update-job-statistics. - Check the timing and rows examined for the query joining
job_runsandjob_classes_registry.
Proposed improvement
Group completed runs by class ID first, then look up each class name once. This preserves the statistics and excludes running jobs and runs whose class is missing from the registry.
On a local MariaDB fixture with 630,000 retained runs, median query time fell from 209 ms to 124 ms across ten alternating runs. All 92 result rows matched. The query still reads the retained history, but it performs far fewer registry lookups.
-> Proposed fix in PR #1292
- Lingua principale
- JavaScript
- Stelle
- 134
- Fork
- 71
- Merge medio
- 18h 56m
- PR unite (30g)
- 33
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nextcloud/serverinfo
-
1. to develop bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nextcloud/serverinfo#1296 ·
I maintainer di solito rispondono entro 1 giorno
-
1. to develop bug good first issue
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
nextcloud/serverinfo#1266 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Database checks: ∞% reported as Failing when counter is zero; no way to acknowledge/mute a checkAperta0. Needs triage bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
nextcloud/serverinfo#1231 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
1. to develop bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
nextcloud/serverinfo#1224 · 7 commenti · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage bug needs info
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
nextcloud/serverinfo#1223 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di nextcloud/serverinfo
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
MetaMask/eth-phishing-detect#317371 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
erkamyaman/safe-anything#262 ·
I maintainer di solito rispondono entro 1 giorno
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
erkamyaman/rust-anything#963 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
brystmar/breadsheet-ui#78 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100