Server Info’s slowest-jobs refresh gets expensive as job history grows
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 18/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- database, performance
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- JavaScript
- Estrellas
- 134
- Forks
- 71
- Merge medio
- 18 h 56 min
- PR fusionados (30 d)
- 33
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de nextcloud/serverinfo
-
1. to develop bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nextcloud/serverinfo#1296 ·
Los mantenedores suelen responder en 1 día
-
1. to develop bug good first issue
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
nextcloud/serverinfo#1266 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Database checks: ∞% reported as Failing when counter is zero; no way to acknowledge/mute a checkAbierto0. Needs triage bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
nextcloud/serverinfo#1231 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
1. to develop bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
nextcloud/serverinfo#1224 · 7 comentarios · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
0. Needs triage bug needs info
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
nextcloud/serverinfo#1223 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de nextcloud/serverinfo
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
MetaMask/eth-phishing-detect#317371 ·
Los mantenedores suelen responder en 1 día
-
good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
erkamyaman/safe-anything#262 ·
Los mantenedores suelen responder en 1 día
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
erkamyaman/rust-anything#963 ·
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
brystmar/breadsheet-ui#78 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100