Slow storing of data for shefParser
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- backend, performance
調査の方向性
添付されたshefitファイルを使って shefParser -i $FILE --loader cda[$CDA_API_ROOT][$CDA_API_KEY] --processed コマンドを再現し、その後、報告されたリクエストとconnection-poolのtracebackを併せて shef/loaders/cda_loader.py を調査してください。利用可能であればCatalinaのログを使って、遅いストアと500レスポンスの原因を特定してください。ファイルが正常にストアされ、報告された実行時間に対して測定可能な改善が得られれば完了です。
索引モデルが issue の本文から書いたものです。
説明
@jbkolze @krowvin
We are utilizing shefParser to store data for a couple of our data acquisition processes as we prepare for cloud migration. Those processes either store shefit files to the database with cda, or store shef.e files to the database with cda. It seems to be significantly slower than processShefit was or our old direct-store methods.
For example, utilizing our MRRPPCS data stream, which uses a diode to send main stem data once an hour. For this process, shefParser ingests shefit files and stores them.
Each hour the 6 main stem projects send 14 values (for a total of approximately 84 values). The shefParser program takes on average 8 minutes to store these values.
An example shefit file is attached. Our bash script cycles through 6 shefit files (one for each project) and stores the data. It does this twice since the diode can send data to one of two folders depending on which machine is sending the data. Total runtime is generally 8 minutes to store these 12 files.
Argument used in the bash script:
shefParser -i $FILE --loader cda[$CDA_API_ROOT][$CDA_API_KEY] --processed
Error we see from the bash script log (specifically it seems worrisome to see the "too many 500 responses" and connection pool lines):
Traceback (most recent call last):
File "/<python path>/python3.9/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "/<python path>/python3.9/site-packages/urllib3/connectionpool.py", line 876, in urlopen
return self.urlopen(
File "/<python path>/python3.9/site-packages/urllib3/connectionpool.py", line 876, in urlopen
return self.urlopen(
File "/<python path>/python3.9/site-packages/urllib3/connectionpool.py", line 876, in urlopen
return self.urlopen(
[Previous line repeated 3 more times]
File "/<python path>/python3.9/site-packages/urllib3/connectionpool.py", line 866, in urlopen
retries = retries.increment(method, url, response=response, _pool=self)
File "/<python path>/python3.9/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='<T7 CDA>', port=<port>): Max retries exceeded with url: /nwdm-data/timeseries?create-as-lrts=False&store-rule=REPLACE+WITH+NON+MISSIN
G&override-protection=False (Caused by ResponseError('too many 500 error responses'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/<python path>/python3.9/site-packages/shef/loaders/cda_loader.py", line 291, in limited_task
return await asyncio.to_thread(
File "/<python path>/python3.9/asyncio/threads.py", line 25, in to_thread
return await loop.run_in_executor(None, func_call)
File "/<python path>/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/<python path>/python3.9/site-packages/cwms/timeseries/timeseries.py", line 354, in store_timeseries
return api.post(endpoint, data, params)
File "/<python path>/python3.9/site-packages/cwms/api.py", line 335, in post
with SESSION.post(endpoint, params=params, headers=headers, data=data) as response:
File "/<python path>/python3.9/site-packages/requests/sessions.py", line 637, in post
return self.request("POST", url, data=data, json=json, **kwargs)
File "/<python path>/python3.9/site-packages/requests_toolbelt/sessions.py", line 76, in request
return super(BaseUrlSession, self).request(
File "/<python path>/python3.9/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/<python path>/python3.9/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/<python path>/python3.9/site-packages/requests/adapters.py", line 510, in send
raise RetryError(e, request=request)
requests.exceptions.RetryError: HTTPSConnectionPool(host='<T7 CDA>', port=<port>): Max retries exceeded with url: /nwdm-data/timeseries?create-as-lrts=False&store-rule=REPLACE+WITH+NON+MISSING&
override-protection=False (Caused by ResponseError('too many 500 error responses'))
We can try to get some additional information from the catalina logs if that's necessary.
When we have had missing data, the slowness of shefParser makes it unusable. We have had to revert back to processShefit when we had to backfill more than a few hours.
- 主要言語
- Python
- スター
- 4
- フォーク
- 2
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
HydrologicEngineeringCenter/SHEF_processing のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
HydrologicEngineeringCenter/SHEF_processing#82 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
HydrologicEngineeringCenter/SHEF_processing の issue をすべて見る
似ている issue
-
[Bug]: graphify query loads every language extractor just for _file_stem (about 34 ms per call)対応中かも @rohit-jsfreaky が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Graphify-Labs/graphify#5160 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Variable declared without a value suppresses ${VAR:-default} expansion対応中かも @Omarinho12345 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
theskumar/python-dotenv#750 ·
メンテナーはふだん 12 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Operations on a list[T] | None var throw when the value is None対応中かも @masenf が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
reflex-dev/reflex#7826 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
UKGovernmentBEIS/control-arena#947 ·
メンテナーはふだん 1 日以内に返信