docs: API負荷試験の事前調査結果と試験計画を追加 - #435
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughSeeFT APIの事前調査、本番構成、負荷シナリオ、k6試験手順、判定基準、リスク、後続作業を文書化し、以前の実測結果章を削除しています。 ChangesAPI負荷試験計画
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/development/load-test-plan.md`:
- Line 3:
「作成日」の日付を現在の実際の作成日である2026年7月16日に修正するか、2026年7月17日が予定日であることが明確に分かる表記へ変更してください。
- Line 220: Remove the concrete production IP address from the documentation
sentence near the production configuration reference, and describe the
destination only as the shared Patroni-managed HA cluster. Keep the actual
address exclusively in access-controlled operational documentation.
- Line 266: load-test-plan.md のRPS記述を修正し、300人が5分間に1〜2リクエストを送る前提では平均約1〜2
req/sとして計算する。50〜100
req/sを維持する場合は、数秒以内の集中バーストなど具体的な時間窓と根拠を明示し、DBクエリ量およびVU計画の前提も整合させる。
- Line 327: 明確化する必要があるのは、S2の1
VU・60秒サイクルにおける操作確率モデルです。各エンドポイント操作を排他的な分岐として合計100%になるよう確率を定義するか、独立実行として1分あたりの期待操作回数を明記し、GET
/shift-cards、GET /shifts/tasks/...、レスキュー系、タスク系、POST /rescues、POST
/reviewsの実行条件と回数を再現可能な形に書き直してください。
- Around line 228-230: Clarify the load-test plan that the isolated postgres:18
setup provides only an “API implementation + isolated DB” baseline. Explicitly
state that its results must not be generalized to the production Patroni
cluster, whose hardware, configuration, and shared-resource contention are not
reproduced, while preserving the policy of excluding the shared production
database from load tests.
- Line 449: Update the RESCUE_GAS_URL HTTPS stub setup in the load-test plan to
install a dedicated trusted CA in the test container or configure the HTTP
client’s RootCAs for the self-signed certificate. Ensure POST /rescues succeeds
without TLS errors, and do not use InsecureSkipVerify.
- Line 138: load-test-plan.md
のエンドポイント内訳を表の分類と一致させてください。web_signin・web_signup・web_signoutをadmin(凍結)に含め、GET
/tasksをmobile側に数える前提で、adminを30ルート、デッドルートを27ルートとして本文の集計と説明を更新してください。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9ae526f5-ac8c-4695-81c8-25e49f9bde74
📒 Files selected for processing (1)
docs/development/load-test-plan.md
- 本番DB内部IPアドレスの記載を削除し共有Patroniクラスタとのみ記載 - エンドポイント集計のadmin(凍結)/デッドルート数の入れ替わりを修正(30/27) - 隔離DBの試験結果を本番クラスタへ一般化しない旨を明記 - 300人×5分のRPS試算を修正し、クエリ増幅率とバースト幅の前提を明示 - S2シナリオの操作確率を独立試行として明確化(合計164%の曖昧さを解消) - RESCUE_GAS_URLスタブのTLS検証(信頼済みCA導入)の注意点を追加 - 作成日の表記を修正
GM・FinanSuはMySQL側(SeeFTはPostgres側)で接続プールは別物であり、 「接続上限の共有」という説明は不正確だった。実際のリスクはMySQL Server・ PostgreSQL・Patroni・etcdが同じ3台の物理ノード上で同居している点にあり、 既知のMySQLスワップ枯渇インシデントを実例として明記した。
インフラ班によるシナリオ①再試験の結果を8章として追記。シフトデータの 分散(1日50件→date_id1〜4に12件ずつ)、pgbouncer導入、N+1修正(PR #438) それぞれの効果を切り分けて記録。pgbouncerは500エラー・タイムアウトを 解消するが、N+1修正はその後も独立して+31%スループット・約4倍のレイ テンシ改善をもたらすことを実測。 また、本試験が2.4節の方針(隔離DBのみで試験)から外れ共有HAクラスタ上で 実施された点を確認事項として明記した。
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/development/load-test-plan.md`:
- Around line 541-553:
実測結果の表にp95およびp99の応答時間列を追加し、各負荷条件の実測値を記入してください。値を取得できない場合は、今回の結果を試験計画のpass/fail判定対象外と明記し、平均応答時間のみで判定しないようにしてください。
- Around line 541-553: Align the load-test description and table around the hey
command with the S1 burst model: either replace it with a k6
arrival-rate/stage/parallel scenario that sends 400 users within two seconds, or
explicitly label the current command as steady 200 req/s for 60 seconds. Also
document the hey timeout setting and the criteria used to calculate timeouts.
- Around line 559-560: 「プーラー導入だけで 500
エラー・タイムアウトが全て解消する」という断定を、再試験条件ではタイムアウトが発生しなかった旨の記述に変更する。初回試験と再試験ではシフト分布などの条件が異なるため、pgbouncer単独の因果効果を示さない表現にし、接続数制御がない点と非導入環境で再現しうる点は維持する。
- Around line 562-564: Update section 8.3 and the issue 3・4 execution
prerequisites to require a completed isolated database environment before
testing starts. Remove shared HA cluster use as a normal option; if an exception
is permitted, require explicit approval and resource monitoring.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: fe244907-4565-4007-8f19-142c3f05a1e4
📒 Files selected for processing (1)
docs/development/load-test-plan.md
| ### 8.3 試験環境についての確認事項 | ||
|
|
||
| 本節の試験は 2.4 節が明示した方針(「DB は共有クラスタに向けた試験を最初から実施しない」)から外れ、共有 HA クラスタ上の専用データベースに対して実施されている。結果として巻き込み事故は発生していないが、これは「今回はたまたま問題が起きなかった」以上の保証ではない。今後の試験(issue 3・4 の Track A/B 実行時など)でも同様に共有基盤を使うか、2.4 節の方針通り隔離 DB 環境を別途整備するかは、GM・FinanSu との巻き込みリスク(同一物理ノード上での CPU・メモリ・スワップ圧迫)を踏まえて改めて MT で確認する |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
共有HAクラスタ利用を後続試験の選択肢として残さないでください。
PRの方針は隔離DBのみの利用です。今回の逸脱を記録するだけでなく、issue 3・4を「隔離DB環境の整備完了」を開始条件にし、共有クラスタを使う場合は明示的な例外承認と資源監視を必須にしてください。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/development/load-test-plan.md` around lines 562 - 564, Update section
8.3 and the issue 3・4 execution prerequisites to require a completed isolated
database environment before testing starts. Remove shared HA cluster use as a
normal option; if an exception is permitted, require explicit approval and
resource monitoring.
There was a problem hiding this comment.
ご指摘の通り、共有基盤利用を今後の選択肢として緩く残す書き方は不適切でした。この章自体をPRのスコープ外として削除し、Notion側の記録に移します。移す際に、issue 3・4(Track A/B試験)は隔離DB環境の整備完了を開始条件とし、共有クラスタを使う場合は明示的な例外承認と資源監視を必須にする、という強い書き方に修正します。
There was a problem hiding this comment.
@taminororo、ご対応方針ありがとうございます。セクション 8 を本 PR から外し、記録を Notion 側へ移す判断で問題ありません。
後続の Track A/B 試験については、隔離 DB 環境の整備完了を開始条件とし、共有 HA クラスタの利用は通常の選択肢にせず、必要な場合のみ明示的な例外承認と資源監視を必須にする、という整理でお願いします。
この前提を追跡可能にする GitHub のフォローアップ issue も作成しましょうか? 🐇
You are interacting with an AI system.
CodeRabbitのpre-merge check(Out of Scope Changes)で、実行済みの試験 結果を「ドラフト・未実行」スコープの本PRに含めるべきでないと指摘され たため、追加していた8章を削除する。実測結果はNotion側の運用ドキュ メントに記録する方針に変更した(issue #434へコメント予定)。
対応Issue
resolve #434
概要
45th 本番前の API 負荷試験に向けた事前調査と試験計画(ドラフト・未実行)を
docs/development/load-test-plan.mdとして追加します。NUTFes Bingo 負荷試験報告書の方法論(原因切り分け、内部直結 vs 公開URL経由の比較、p95/p99 での pass/fail 基準)を踏襲しています。主な内容:
調査で判明した試験計画外のトピック(Access-Token ヘッダ欠落時の panic、
POST /request_shiftsのデッド化、mobile 静的配信のシングルスレッド問題など)は文書内のリスク・issue 提案節に記録しています。画面スクリーンショット等
テスト項目
ファイル:行番号引用が実コードと一致していること(スポットチェックで可)api/lib/router/router.goの全ルート +/swagger/*を網羅していること備考
試験の実行は本 PR のスコープ外です。マージ後、文書 7 章の提案に基づき後続 issue を起票してから着手します。
Summary by CodeRabbit