Server Info’s slowest-jobs refresh gets expensive as job history grows
Maintainer thường phản hồi trong vòng 1 ngày
Đá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
- 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ả
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
- 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
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nextcloud/serverinfo
-
1. to develop bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nextcloud/serverinfo#1296 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
1. to develop bug good first issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
nextcloud/serverinfo#1266 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Database checks: ∞% reported as Failing when counter is zero; no way to acknowledge/mute a checkĐang mở0. Needs triage bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
nextcloud/serverinfo#1231 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
1. to develop bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
nextcloud/serverinfo#1224 · 7 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
0. Needs triage bug needs info
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
nextcloud/serverinfo#1223 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của nextcloud/serverinfo
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MetaMask/eth-phishing-detect#317371 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
erkamyaman/safe-anything#262 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
erkamyaman/rust-anything#963 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
brystmar/breadsheet-ui#78 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100