Slow endpoints: where the time goes

Đang mở
#2,182 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 2 ngày

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

Từ ngày 30/10/2026.

  • #2212 của @alanpeixinho — đang mở

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
15/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
postgresql, python
Lĩnh vực
backend, databases

Hướng nghiên cứu

This is a survey of slow endpoints, not one scoped change. Start with the get_hardware_details_data call that hardwareDetailsBuilds depends on, and the checkouts__timestamp lookup in the treeDetailsBuildsDirectView case. Pick one endpoint and its EXPLAIN (ANALYZE, BUFFERS) output, then show a before/after timing for that one endpoint. Done means a measured reduction for that endpoint, not a list of suggestions.

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

Mô tả

Uncached calls on 2026-10-15 against the tunneled database. Each row is a more expensive case of that endpoint, so the time can sit well above a typical call. The list is here so those worst cases get optimized too. Execute is cursor.execute, Fetch is fetchall, Processing is the rest of the request. The plan is EXPLAIN (ANALYZE, BUFFERS) on the heaviest query. The suggestion is an LLM reading of that profile, not a measured fix.

Endpoint Case Execute Fetch Processing Plan LLM suggestion
labs 7 days, maestro 71 s 0 0 66 s server. Parallel append, 35 rows. 639,354 pages read, 121,865 hit Group by lab_id. The misc->>'lab' / misc->>'runtime' fallback reads every build and test in the window.
labOriginsView 30 days 83 s 0 0 Same query, warm on 7 days: bitmap heap scan, 1.3M test rows, 307,977 hit, 237 read, server 1.5 s Partial index on (start_time, origin) WHERE lab_id IS NOT NULL.
treeReportView mainline, 720 h 39 s 0.3 s 0 Checkout summary on the 24 h call: nested loop, 6,644 rows, 46,790 hit, server 1.4 s. That is not this 39 s The history query reads every test on the branch for max_age_in_hours, then keeps group_size per group. Both windows returned 16,013 rows. Bound that scan.
treeCommits next 4eb2586, 260k rows 68 s 8.3 s 1.1 s Nested loop, server 2.3 s, estimate 32k, actual 260k. 1,617,452 hit Aggregate in SQL.
treeDetailsView same commit, 55k rows 33 s 3.2 s 1.3 s Same shape as the tests listing: server ~0.4 s, sort spill ~9k temp pages Select the columns the page renders.
treeDetailsTestsView same commit 27 s 3.0 s 1.2 s Nested loop, 54,720 rows, server 0.39 s, 179,976 hit, temp read/write 8,939 / 8,940 Same. The external merge is about 0.1 s.
treeDetailsTestsDirectView same commit 26 s 2.8 s 1.2 s Same plan Same.
hardwareDetailsBuilds kubernetes, 5 days 277 s 17 s 6 s Same SQL as hardware details. qemu-arm64, 1 day: gather merge, 157 rows, server 0.23 s, 11,603 hit Query builds. This view calls get_hardware_details_data and then keeps the builds (304,141 test rows).
hardwareDetails kubernetes, 5 days 105 s 16 s 13 s Same gather Drop tests.misc, builds.misc, comment, and log_url from the listing select. stm32 (56k rows) was 39 s of execute.
treeDetailsBuildsDirectView mainline 1229e2e57a5c, 67 builds 11 s 0 0 A 78-build next checkout: nested loop, server 2 ms, 574 hit. On this commit the checkout lookup was an index scan backward on checkouts__timestamp, 501,254 hit, 364 ms once warm Look the checkout up by hash. The 128-build checkout took 0.37 s.
treeDetailsTestsCompareView two mainline commits 5.7 s 0.5 s 0.2 s Incremental sort, 82,089 rows, server 1.1 s. Sort node 290–626 ms. 25,748 hit The diff sort is the server cost, and 59k rows still cross the tunnel.
issue 30 days, 1,011 rows 3.9 s 0 0.1 s Heaviest of 5 queries, 7-day call: nested loop costed around 12M, 17 rows in 286 ms, 312,499 hit That join. 7 days was 3.7 s.
treeCompare those two commits 3.0 s 0 0 Nested loop, 391 rows, server 42 ms, 25,748 hit Five small queries.
issueDetails one issue, version 1 2.7 s 0 0 Anti-join, 46 rows × 4 loops, server 94 ms, 20,812 hit. Eight queries Little in the explained query.
hardwareDetailsSummary kubernetes, 5 days 34 s 0.3 s 0.1 s qemu-arm64, 1 day: append, 116 rows, server 0.21 s, 15,099 hit. The summary reads tests.misc Read hardware_status counters. This call returned 2,919 rows.
testStatusHistory one ltp path, no match 0.2 s 0 2.2 s LIMIT, server 1.6 s, 0 rows. 7,852 pages read, 6,137 hit Index path, config, branch, and start_time, so the limit can stop.
treeCommitsHistory one mainline hash, 212 rows 1.3 s 0 0 Append, server 0.79 s, 185,921 hit The append reads a lot of pages per returned row.
hardwareSelectors maestro 1.0 s 0 0 Nested loop, 18,416 rows × 2, server 0.34 s, 164,812 hit Already about 1 s.
treeDetailsBootsDirectView 530 boots 0.9 s 0.1 s 0 250-boot next commit: nested loop, server 26 ms, 16,772 hit The longer list stayed at 1 s.
treeDetailsBootsCompareView those two commits, 137 rows 0.5 s 0 0 Nested loop, 391 rows, server 42 ms, 25,748 hit Nothing to change.

Requests, so the runs can be repeated. Hardware and issue windows end at 2026-10-15 17:20 UTC.

Endpoint Method Path Parameters
labs GET /api/labs/ origin=maestro, interval_in_days=7
labOriginsView GET /api/labs/origins/ interval_in_days=30
treeReportView GET /api/tree-report/ origin=maestro, git_branch=master, tree_name=mainline, git_url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git, max_age_in_hours=720. Defaults: path=%, group_size=3, min_age_in_hours=0
treeCommits GET /api/tree/4eb2586bd40db27d77cc5b724ca9386ed0c71d53/commits origin=maestro, git_branch=master, git_url=https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
treeDetailsView GET /api/tree/4eb2586bd40db27d77cc5b724ca9386ed0c71d53/full same origin, git_branch, git_url
treeDetailsTestsView GET /api/tree/4eb2586bd40db27d77cc5b724ca9386ed0c71d53/tests same
treeDetailsTestsDirectView GET /api/tree/next/master/4eb2586bd40db27d77cc5b724ca9386ed0c71d53/tests origin=maestro
hardwareDetailsBuilds POST /api/hardware/kubernetes/builds origin=maestro, selectedCommits={}, 5-day window
hardwareDetails POST /api/hardware/kubernetes same body
treeDetailsBuildsDirectView GET /api/tree/mainline/master/1229e2e57a5c2980ccd457b9b53ea0eed5a22ab3/builds origin=maestro
treeDetailsTestsCompareView GET /api/tree/mainline/master/compare/tests origin=maestro, hash_a=1229e2e57a5c2980ccd457b9b53ea0eed5a22ab3, hash_b=ca3e345926b00bd59106c1bf2022b1daf4164a67
issue GET /api/issue/ 30-day startTimestampInSeconds / endTimestampInSeconds
treeCompare GET /api/tree/mainline/master/compare origin=maestro, same hashes
issueDetails GET /api/issue/maestro:b5ed9b51212f5174ccbd9d812fc43e26fcc5361e version=1
hardwareDetailsSummary POST /api/hardware/kubernetes/summary same 5-day body
testStatusHistory GET /api/test/status-history path=ltp.float_power, origin=maestro, git_repository_url=https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git, git_repository_branch=master, config_name=olddefconfig, group_size=10, current_test_start_time=2026-10-12T23:58:10.910439Z
treeCommitsHistory GET /api/tree/commits-history origin=maestro, tree_name=mainline, git_branch=master, git_url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git, commit_hashes=1229e2e57a5c2980ccd457b9b53ea0eed5a22ab3
hardwareSelectors GET /api/hardware/selectors/ origin=maestro
treeDetailsBootsDirectView GET /api/tree/media-committers/next/274af88c8acaa4bb538791047bd17fa5136ba78f/boots origin=maestro
treeDetailsBootsCompareView GET /api/tree/mainline/master/compare/boots origin=maestro, same hashes
Ngôn ngữ chính
Python
Star
10
Fork
32
Merge trung bình
3 ngày 19 giờ
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 kernelci/dashboard

Tất cả issue của kernelci/dashboard

Issue tương tự

Thêm issue về Python

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.