Track /bulk-lookup query times in /status, e.g. as recent_bulk_queries

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

Chưa có ai nhận issue này.

Đá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
35/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
kubernetes, python
Lĩnh vực
api, backend, observability

Hướng nghiên cứu

Read api/server.py, especially lookup() and RecentLookups, and the recent_queries section of documentation/API.md; compare the existing /lookup tracking with bulk_lookup(). The issue leaves the entry unit, reported metrics, warning thresholds, and tracker design open. Done means those choices are settled and /status provides useful bulk latency and failure visibility without distorting /lookup statistics or adding undue probe cost.

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

Mô tả

/status's recent_queries times /lookup only. #231 deliberately leaves /bulk-lookup out: bulk_lookup() calls lookup(..., bulk=True) for each string, and those calls are neither recorded in the window nor logged as SLOW QUERY warnings. That keeps recent_queries meaning what its docs say. A single bulk request can hold thousands of strings, enough to swamp a 50000-entry window, and its strings compete with each other for Solr in a way a /lookup caller's doesn't, which would skew the percentiles. (See the bulk parameter's docstring on lookup() in api/server.py, and the recent_queries section of documentation/API.md.)

That leaves no latency or failure visibility for bulk traffic beyond the one Bulk lookup query for N strings ... took Xms INFO line per request. Bulk is the path NER pipelines use, so it is likely where most Solr load comes from.

One option is a separate tracker, e.g. recent_bulk_queries alongside recent_queries in /status. Questions to settle:

  • What is one entry: a request or a string? Per request is closest to what a caller sees, but the times are only comparable after normalising by string count. Per string is comparable with recent_queries, but needs a window sized differently, or one bulk request still dominates it.
  • What to report. Candidates: requests, strings per request, end-to-end time per request, per-string mean and p99 Solr wait, time spent waiting on the SOLR_MAX_CONCURRENT_LOOKUPS semaphore (which lookup()'s own timer doesn't include), and errors/timeouts/cancelled as in recent_queries.
  • Logging. Should a slow bulk request (by some per-string or total threshold) get its own WARNING, instead of the per-string SLOW QUERY lines that were dropped?
  • Cost. /status is what the Kubernetes probes call. RecentLookups in api/server.py keeps running totals and caches percentiles for this reason, and a second tracker should do the same, or reuse that class.

Related: #286 (query-rate windows for recent_queries).

Ngôn ngữ chính
Python
Star
5
Fork
4
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

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 NCATSTranslator/NameResolution

Tất cả issue của NCATSTranslator/NameResolution

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.