Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ISUCON で使えるツールを作った
Search
kanata
May 10, 2022
Technology
1.4k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ISUCON で使えるツールを作った
社内 LT で話した資料です。
紹介するツールは公開しておりますが、動作の保証はいたしかねます。
*
isucontinuous
*
デモ動画
*
デモで利用したリポジトリ
kanata
May 10, 2022
More Decks by kanata
See All by kanata
今 SLI/SLO の監視をするなら Sloth が良さそうという話
shotakitazawa
2
1.3k
CloudNative Days を支える CI/CD ワークフローの変遷
shotakitazawa
2
2.1k
OpenFlow について
shotakitazawa
0
100
Kubernetes で Pod ができるまで
shotakitazawa
3
1.2k
Spinnaker で Blue-Green Deployment やってみた
shotakitazawa
1
1.5k
Other Decks in Technology
See All in Technology
GitHub Agentic Workflows を触ってみる
htkym
1
130
[Kiro Meetup #7] Kiro Crew Dive Deep
konippi
0
300
サーバーレスをどこまで使う? WebRTC対戦ゲームで選んだVPSとの共存設計
kaidouji85
0
420
Azure Serverless 2026:Production-ready な AI エージェント基盤 / Azure Serverless 2026: Production-Ready AI Agent Platform
miyake
2
590
2026-09-08 そのJavaモダナイゼーション、AIに丸投げで大丈夫?IBM Bobで変わる品質と効率
yutanonaka
1
180
なぜ「決定性」が 決定的に重要なのか? Durable Execution 基盤の数理的理解 #serverlessjp / ServerlessDays Tokyo 2026
ytaka23
4
1.3k
アクセスキーこわい やめかたと漏らさない工夫
sassssan68
1
740
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
12k
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
2
20k
AI感のないAWS構成図をAIエージェントに描かせたい!
sagochiko
1
340
高負荷プロダクション環境におけるAWS Lambdaのリアル 〜スケールとコストを左右する実行ライフサイクルの技術仕様〜
maimyyym
2
520
What the customer really needed
kawaguti
PRO
3
220
Featured
See All Featured
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
420
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
950
Ruling the World: When Life Gets Gamed
codingconduct
0
360
It's Worth the Effort
3n
188
29k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
Ethics towards AI in product and experience design
skipperchong
2
380
Transcript
ISUCON で使えるツールを 作った 北澤 祥太 / kanata 1
$ whoami 北澤 祥太 / kanata / かなた @kanatakita ShotaKitazawa
所属: LINE 株式会社 Verda 室ネットワーク開発チーム (2022/04〜) 趣味: ラーメン、スノボ、自宅鯖構築、イベント裏方 ISUCON歴: ISUCON6〜 • ISUCON11 予選作問担当, ISUCON9・7 本戦出場 (7は学生枠) 2 よく使う アイコン
突然ですが ISUCON 知ってますか? 3
「ISUCON」は、LINE株式会社の商標または登録商標です。(https://isucon.net) ISUCON とは、LINE株式会社が運営窓口となって開催している 「お題となる Web サービスを決められたレギュレーションの中で 限界まで高速化を図るチューニングバトル」です。 (Twitter より) 4
5 web サービスが動いているサーバの ssh アクセス情報が競技者に渡される 競技者がベンチマークを実行するとベンチ用マシン から競技者用マシンへ沢山のリクエストが飛ぶ リクエストが捌けた数等で算出される点数を競う 様々なミドルウェアや特定の言語 (Go,
Python, Ruby, ...) で書かれた Web アプリケーションが配置されている 雑な紹介
ツールの誕生背景 • ISUCON で勝つためには「実装→ベンチマーク→プロファイリング」の フィードバックループを限りなく高速に回すことが必要 • もともと弊チームでは以下のデプロイスクリプトを実装し利用していた ◦ 開発用ソフトウェアのインストール ◦
git リポジトリ上のソースコードをデプロイ ◦ プロファイルデータを Slack に POST (プロファイリングは手動) • 競技中、上記スクリプトに困らせられることが多々... ◦ スクリプト内に環境依存な処理がある (eg. web サーバは nginx 前提) ▪ ISUCON10f は Envoy ◦ プロファイルデータ収集スクリプトが複数台構成に対応していない ◦ 複数人でのデプロイが考慮されていない ▪ 「デプロイしまーす」「いいよー」 6
isucontinuous https://github.com/ShotaKitazawa/isucontinuous • 「開発→デプロイ→ベンチマーク→プロファイリング」の一連の流れを 複数人で行いやすくするためのツール • 8 種のサブコマンドを提供 ◦ init,
setup, import, push, sync, deploy, profiling, afterbench • 各種コマンドは設定ファイル (isucontinuous.yaml) を元に動作 7
init 8 isucontinuous local-repo └─── isucontinuous.yaml setup Git local repository
host01 host02 host03
setup 9 isucontinuous host01 host02 host03 install some software (eg.
Docker) based on isucontinuous.yaml local-repo └─── isucontinuous.yaml
import 10 host01 host02 host03 /etc/nginx /etc/mysql ... /etc/nginx /etc/mysql
... /etc/nginx /etc/mysql ... isucontinuous local-repo ├──── isucontinuous.yaml ├──── host01/… ├──── host02/… └──── host03/… download some files from servers based on isucontinuous.yaml
push 11 isucontinuous host01 host02 host03 local-repo ├──── isucontinuous.yaml ├────
host01/… ├──── host02/… └──── host03/… push to remote repository
sync 12 isucontinuous host01 host02 host03 local-repo ├──── isucontinuous.yaml ├────
host01/… ├──── host02/… └──── host03/… fetch & merge from remote repository
deploy 13 isucontinuous host01 host02 host03 local-repo ├──── isucontinuous.yaml ├────
host01/… ├──── host02/… └──── host03/… fetch & switch to detached branch deploy some files to servers based on isucontinuous.yaml /etc/nginx /etc/mysql ... /etc/nginx /etc/mysql ... /etc/nginx /etc/mysql ...
profiling 14 isucontinuous host01 host02 host03 execute profiling command via
ssh based on isucontinuous.yaml
afterbench 15 isucontinuous host01 host02 host03 execute analyze command via
ssh based on isucontinuous.yaml post profile data
isucontinuous.yaml (1/3) setup: docker: netdata: version: latest public_port: 19999 alp:
version: v1.0.8 slack: default_channel_id: "C012BGJSJMC" hosts: - host: localhost user: &user root key: &key /root/.ssh/id_rsa 16
isucontinuous.yaml (2/3) hosts: - … (省略) deploy: &deploy slack_channel_id: ""
pre_command: >- rm -f "{{.Env.ACCESSLOG_PATH}}"; rm -f "{{.Env.SLOWLOG_PATH}}"; post_command: >- sudo systemctl restart mysql nginx && sudo systemctl restart isucondition.go.service targets: - src: nginx target: /etc/nginx - src: mysql target: /etc/mysql - src: go target: /home/isucon/webapp/go compile: make 17
isucontinuous.yaml (3/3) hosts: - … (省略) profiling: &profiling command: >-
PPROF_TMPDIR=/pprof/{{.Git.Revision}} /home/isucon/local/go/bin/go tool pprof /home/isucon/webapp/go/isucondition http://localhost:6060/debug/fgprof?seconds=90 after_bench: &after_bench slack_channel_id: "" target: /profile/{{.Git.Revision}}/ command: >- mkdir -p /profile/{{.Git.Revision}}; PPROF_FILENAME=$(ls /root/pprof/tmp/ -tr | tail -n1); if [ -f "/root/pprof/tmp/$PPROF_FILENAME" ]; then /home/isucon/local/go/bin/go tool pprof -top -cum /root/pprof/tmp/$PPROF_FILENAME > /profile/{{.Git.Revision}}/pprof_top_cum; fi; cat "{{.Env.ACCESSLOG_PATH}}" | alp ltsv -r --sort sum > /profile/{{.Git.Revision}}/accesslog; cat "{{.Env.SLOWLOG_PATH}}" | docker run -i --rm matsuu/pt-query-digest > /profile/{{.Git.Revision}}/slowlog; 18
ユースケース1: 初期セットアップ 1. init : ローカルリポジトリの新規作成 2. isucontinuous.yaml の編集 3.
setup : 各種開発用ソフトウェアのインストール 4. import : 各種設定ファイルやソースコードを Git で管理 5. push : GitHub に push 19
ユースケース2: 開発・デプロイ 1. GitHub に push したリポジトリを元に各メンバーが各ブランチで作業 ※ 開発用ローカルリポジトリは isucontinuous
により作成されたものとは別に用意 2. deploy : 特定リビジョンの各ファイルを各サーバにデプロイ 3. profiling : 各サーバにてプロファイリング用コマンドを実行 4. afterbench : プロファイルデータを収集し Slack に送信 20
ユースケース3: 開発中サーバ上の新たなファイルを Git 管理 1. redis 等、サーバーに新たなミドルウェアがインストールされる 2. sync :
ローカルリポジトリを remotes/origin/master と同期 3. isucontinuous.yaml に新たな import/deploy 対象を追記 4. import : 各種設定ファイルやソースコードを Git で管理 5. push : GitHub に push 21
デモ (ユースケース2) https://drive.google.com/file/d/1exHR5T5_WDEHCfncA7RWrQoejPxHIRl0/view?usp=sharing 22
最後に ISUCON12, 勝ちたい!!! まずは参加枠争奪戦と0次予選 (当日時間通りに起きる) をがんばります。 予選参加確定プランは間に合わなかった... 23
参考 • isucontinuous ◦ https://github.com/ShotaKitazawa/isucontinuous • デモで利用したリポジトリ ◦ https://github.com/ShotaKitazawa/isucon11q-20220505 24