Skip to content

docs: API負荷試験の事前調査結果と試験計画を追加 - #435

Open
taminororo wants to merge 3 commits into
developfrom
docs/kanba/434/load-test-plan
Open

docs: API負荷試験の事前調査結果と試験計画を追加#435
taminororo wants to merge 3 commits into
developfrom
docs/kanba/434/load-test-plan

Conversation

@taminororo

@taminororo taminororo commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

対応Issue

resolve #434

概要

45th 本番前の API 負荷試験に向けた事前調査と試験計画(ドラフト・未実行)を docs/development/load-test-plan.md として追加します。NUTFes Bingo 負荷試験報告書の方法論(原因切り分け、内部直結 vs 公開URL経由の比較、p95/p99 での pass/fail 基準)を踏襲しています。

主な内容:

  • 全74エンドポイントの棚卸し。認証チェックが3箇所のみであることを網羅確認し、実トラフィックのある現役ルートが15本(mobile 9 + GAS 6)に絞られることを呼び出し元コードまで追って確定
  • rescues 統一/個別の並存は移行途中ではなく分業(作成・閲覧=統一/mobile、ステータス更新=個別PUT/GAS)であることの確定
  • 本番 DB(共有 Patroni クラスタ)に向けた試験を最初から除外し、隔離 DB のみで試験する方針とその技術的根拠(DB 接続プール上限未設定など)
  • 当日の実利用に基づく負荷シナリオ3種(朝の一斉アクセス/日中定常/GASバッチ併走)と、k6 による 50→600 VU 段階昇圧・pass/fail 基準
  • 内部直結(Track A)と検証用トンネル経由(Track B)の切り分け設計
  • 後続 issue の提案(環境整備、試験前修正、Track A/B 実行、別トラックの mobile 静的配信対策ほか)

調査で判明した試験計画外のトピック(Access-Token ヘッダ欠落時の panic、POST /request_shifts のデッド化、mobile 静的配信のシングルスレッド問題など)は文書内のリスク・issue 提案節に記録しています。

画面スクリーンショット等

  • ドキュメント追加のみのため無し

テスト項目

  • 文書内の ファイル:行番号 引用が実コードと一致していること(スポットチェックで可)
  • エンドポイント棚卸し表が api/lib/router/router.go の全ルート + /swagger/* を網羅していること
  • 試験計画が「本番DB・本番トンネルに向けない」制約を満たしていること

備考

試験の実行は本 PR のスコープ外です。マージ後、文書 7 章の提案に基づき後続 issue を起票してから着手します。

Summary by CodeRabbit

  • ドキュメント
    • SeeFT本番(45th production stack)向けの負荷試験計画を新規追加し、事前調査内容も含めて一本化しました。
    • 対象エンドポイント棚卸し、負荷シナリオ(S1〜S3)、k6運用方針、合否基準(p95/p99・5xx=0)を整理しました。
    • 認証トークン運用手順、隔離DBでの実施方針、外部副作用遮断の前提と必要設定を明記しました。
    • リスク表と、今後対応予定(Issue案)をまとめました。

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5d95c14a-5bef-4c40-a01a-ee587b290684

📥 Commits

Reviewing files that changed from the base of the PR and between 0f3c6a0 and 879917a.

📒 Files selected for processing (1)
  • docs/development/load-test-plan.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/development/load-test-plan.md

📝 Walkthrough

Walkthrough

SeeFT APIの負荷試験に向け、エンドポイント調査、本番構成、負荷シナリオ、k6試験手順、判定基準、リスク、後続作業を文書化しています。

Changes

API負荷試験計画

Layer / File(s) Summary
調査範囲とAPI棚卸し
docs/development/load-test-plan.md
試験対象、全エンドポイント、認証挙動、rescues の役割分担を整理。
実行構成と負荷ホットスポット
docs/development/load-test-plan.md
Cloudflare Tunnel経路、隔離DB方針、静的配信制約、API・外部連携・ログ出力の負荷要因を記録。
負荷シナリオと試験手順
docs/development/load-test-plan.md
S1〜S3の利用パターン、k6のTrack A/B、段階昇圧、判定基準、認証・副作用遮断手順を定義。
リスクと後続作業
docs/development/load-test-plan.md
既知のリスク、前提の訂正、試験実行や事前修正に関する後続issue候補を追加。

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed タイトルは負荷試験の事前調査結果と試験計画の追加という主変更を簡潔に表しています。
Description check ✅ Passed 対応Issue、概要、テスト項目、備考が揃っており、テンプレート要件をほぼ満たしています。
Linked Issues check ✅ Passed 74エンドポイント棚卸し、rescues整理、隔離DB方針、負荷シナリオ、k6基準、Track A/B、後続Issue提案が揃っています。
Out of Scope Changes check ✅ Passed 変更は新規ドキュメント追加のみで、目的外のコード変更や無関係な改変は見当たりません。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/kanba/434/load-test-plan

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0c0d9c1 and 2dd901a.

📒 Files selected for processing (1)
  • docs/development/load-test-plan.md

Comment thread docs/development/load-test-plan.md Outdated
Comment thread docs/development/load-test-plan.md Outdated
Comment thread docs/development/load-test-plan.md Outdated
Comment thread docs/development/load-test-plan.md
Comment thread docs/development/load-test-plan.md Outdated
Comment thread docs/development/load-test-plan.md Outdated
Comment thread docs/development/load-test-plan.md Outdated
- 本番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スワップ枯渇インシデントを実例として明記した。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API負荷試験の事前調査結果と試験計画をドキュメント化する

1 participant