Server Info’s slowest-jobs refresh gets expensive as job history grows

Abierto
#1,293 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@melroy89 ya está trabajando en esto.

Desde el 22/11/2026.

  • #1292 de @melroy89 — abierto

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
Stack tecnológico
databases, php, sql

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

1. to develop enhancement
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
  1. On a test instance with a large retained job history, run php occ serverinfo:update-job-statistics.
  2. Check the timing and rows examined for the query joining job_runs and job_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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nextcloud/serverinfo

Todos los issues de nextcloud/serverinfo

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.