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

Đang mở
#1,293 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@melroy89 đang làm issue này rồi.

Từ ngày 22/11/2026.

  • #1292 của @melroy89 — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
18/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
databases, php, sql
Lĩnh vực
database, performance

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
JavaScript
Star
134
Fork
71
Merge trung bình
18 giờ 56 phút
Pull request đã merge (30 ngày)
33

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nextcloud/serverinfo

Tất cả issue của nextcloud/serverinfo

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.