Server Info’s slowest-jobs refresh gets expensive as job history grows
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 18/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- database, performance
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- JavaScript
- スター
- 134
- フォーク
- 71
- 平均マージ
- 18時間 56分
- マージ済み PR(30日)
- 33
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nextcloud/serverinfo のほかの issue
-
1. to develop bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nextcloud/serverinfo#1296 ·
メンテナーはふだん 1 日以内に返信
-
1. to develop bug good first issue
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
nextcloud/serverinfo#1266 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
Database checks: ∞% reported as Failing when counter is zero; no way to acknowledge/mute a checkオープン0. Needs triage bug
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
nextcloud/serverinfo#1231 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
1. to develop bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
nextcloud/serverinfo#1224 · コメント 7 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
0. Needs triage bug needs info
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
nextcloud/serverinfo#1223 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
nextcloud/serverinfo の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MetaMask/eth-phishing-detect#317371 ·
メンテナーはふだん 1 日以内に返信
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
erkamyaman/safe-anything#262 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
erkamyaman/rust-anything#963 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
brystmar/breadsheet-ui#78 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100