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

オープン
#309 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
活発
技術スタック
kubernetes, python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

/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).

主要言語
Python
スター
5
フォーク
4
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NCATSTranslator/NameResolution のほかの issue

NCATSTranslator/NameResolution の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。