بنقرة واحدة
alp-profiling
Install and use alp (Access Log Profiler) to identify slow nginx endpoints and analyze request patterns
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Install and use alp (Access Log Profiler) to identify slow nginx endpoints and analyze request patterns
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
MCP tool reference — exec, benchmark_start, benchmark_status, note_write, etc. Use when: executing commands on VMs, running benchmarks, or recording findings
ISUCON13 contest manual — server topology, service management, benchmark execution, and rules. Use when: checking environment setup, running benchmarks, or understanding contest constraints
ISUPipe application manual — features, terms, constraints, and API specs. Use when: understanding the app domain, checking API behavior or MUST/MAY requirements
General strategy for identifying and adding missing database indexes in ISUCON web applications
General techniques for optimizing user icon/avatar image serving in ISUCON web applications
General techniques for identifying and fixing N+1 query problems in ISUCON web applications
| name | alp-profiling |
| description | Install and use alp (Access Log Profiler) to identify slow nginx endpoints and analyze request patterns |
alp は nginx のアクセスログを LTSV 形式で解析し、遅いエンドポイントを特定するツール。ISUCON では定番のプロファイリング手法。
wget -q https://github.com/tkuchiki/alp/releases/download/v1.0.21/alp_linux_amd64.tar.gz -O /tmp/alp.tar.gz && cd /tmp && tar xzf alp.tar.gz && sudo mv alp /usr/local/bin/ && alp --version
/etc/nginx/nginx.conf の http ブロック内に以下を追加:
log_format ltsv "time:$time_local"
"\thost:$remote_addr"
"\tforwardedfor:$http_x_forwarded_for"
"\treq:$request"
"\tstatus:$status"
"\tmethod:$request_method"
"\turi:$request_uri"
"\tsize:$body_bytes_sent"
"\treferer:$http_referer"
"\tua:$http_user_agent"
"\treqtime:$request_time"
"\tcache:$upstream_http_x_cache"
"\truntime:$upstream_http_x_runtime"
"\tapptime:$upstream_response_time"
"\tvhost:$host";
access_log /var/log/nginx/access.log ltsv;
設定後に nginx をリロード:
sudo nginx -t && sudo systemctl reload nginx
sudo alp ltsv --file /var/log/nginx/access.log --sort sum -r
動的パス(ID 等)を含む URL は -m オプションで正規表現グルーピングする。アプリのルーティングを確認して適切なパターンを設定:
# 例: /api/users/123 や /api/posts/456/comments をグルーピング
sudo alp ltsv --file /var/log/nginx/access.log --sort sum -r \
-m '/api/users/[0-9]+,/api/posts/[0-9]+/comments,/api/posts/[0-9]+$'
ポイント: まずソースコードのルーティング定義 (router) を読んで、パラメータ付き URL を特定してからパターンを作成する。
| Column | 意味 |
|---|---|
| COUNT | リクエスト数 |
| SUM | レスポンス時間合計 |
| AVG | 平均レスポンス時間 |
| MAX | 最大レスポンス時間 |
| P99 | 99パーセンタイル |
sudo truncate -s 0 /var/log/nginx/access.log