원클릭으로
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