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
俺の仕事は AIに奪われないし、たぶんその BIも要らない
hikaruri
0
540
Oracle Cloud Network Path Analyzerを試してみた/I Tried Out Oracle Cloud Network Path Analyzer
masakiokuda
1
110
Goodbye ShellScript, Hello File-based App
shunsock
0
690
Antigravity SDK for the Java Developer
glaforge
0
180
今話題のAI「Jev」って何? 宇宙最速で学ぶ会
minorun365
PRO
30
19k
人間はどの意思決定を手放せるのか
kawasima
15
8k
Vibe Coding で作ったプロダクトをどう安全に動かすか / How to Safely Run Products Built with Vibe Coding
glidenote
0
500
AIに賢く動いてもらうためのコンテキスト〜Snowflake女子会 vol.8
snowwmn0824
0
160
なぜ「決定性」が 決定的に重要なのか? Durable Execution 基盤の数理的理解 #serverlessjp / ServerlessDays Tokyo 2026
ytaka23
3
1.2k
AgentCore Runtime上にAgentic Coding基盤を構築・展開する際の設計ポイントと限界点 / Design considerations and limitations when building an agentic coding platform on AgentCore Runtime
har1101
5
680
Genieを崇めよ
kameitomohiro
0
170
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
3
590
Featured
See All Featured
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
200
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
280
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
570
Faster Mobile Websites
deanohume
310
32k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
HDC tutorial
michielstock
2
880
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Deep Space Network (abreviated)
tonyrice
0
320
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
700
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
600
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
250
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
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