Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Dapper
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
a2-ito
May 17, 2022
Technology
0
67
Dapper
a2-ito
May 17, 2022
Tweet
Share
More Decks by a2-ito
See All by a2-ito
Devin の Org-level Skills
a2ito
0
520
AIエンジニア Devin と歩む、自律型運用プロセスの構築
a2ito
0
900
ECSにおけるBGデプロイの実現
a2ito
0
98
Organizations と Identity Center を Terraform で管理しよう
a2ito
0
120
App Runner 実践
a2ito
0
530
Bigtable
a2ito
0
82
Chord
a2ito
0
73
Chubby
a2ito
0
98
Dynamo
a2ito
0
110
Other Decks in Technology
See All in Technology
TypeScript 7.0の現在地と備え方
uhyo
7
2k
Mitigating geopolitical risks with local-first software and atproto
ept
0
150
システム標準化PMOから ガバメントクラウドCoEへ
techniczna
1
150
2026年もソフトウェアサプライチェーンのリスクに立ち向かうために / Product Security Square #3
flatt_security
1
720
ABEMAのバグバウンティの取り組み
kurochan
1
150
Phase09_自動化_仕組み化
overflowinc
0
390
DDD×仕様駆動で回す高品質開発のプロセス設計
littlehands
1
970
「通るまでRe-run」から卒業!落ちないテストを書く勘所
asumikam
2
420
_Architecture_Modernization_から学ぶ現状理解から設計への道のり.pdf
satohjohn
2
540
ReactのdangerouslySetInnerHTMLは“dangerously”だから危険 / Security.any #09 卒業したいセキュリティLT
flatt_security
0
370
Phase02_AI座学_応用
overflowinc
0
650
スケールアップ企業でQA組織が機能し続けるための組織設計と仕組み〜ボトムアップとトップダウンを両輪としたアプローチ〜
tarappo
3
290
Featured
See All Featured
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
250
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
150
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
320
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Test your architecture with Archunit
thirion
1
2.2k
Color Theory Basics | Prateek | Gurzu
gurzu
0
260
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
160
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
90
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
100
The Mindset for Success: Future Career Progression
greggifford
PRO
0
280
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
400
Transcript
Dapper 2021.6.11 @a2ito
Publication Dapper, a Large-Scale Distributed Sytems Tracing Infrastructure Benjamin H.
Sigelman, Luiz Andr´e Barroso, Mike Burrows, Pat Stephenson, Manoj Plakal, Donald Beaver, Saul Jaspan, Chandan Shanbhag Google Technical Report dapper-2010-1, April 2010
Dapper • Google社内の分散トレーシングツール • Dapper論文をベースにして作られたOSSたち ◦ zipkin - by Twitter
◦ jaeger - by Uber
Summary of contributions • 分散システムのトレーシングに関する基本的な考え方は既存の論文と同様 ◦ Pinpoint, Magpie, X-Trace •
プロダクション環境で何年も運用してきて何を経験し、どのようにプロダクトをイ ンクリメントしてきたか • アプリケーション透過性 ◦ ソフトウェアスタックの十分に低いレベルに限定される
Dapperの分散トレーシング • 分散されたシステムのトレーシングでは、各サーバで 実行されたすべての実行情報を記録する必要がある • トレースはすべての呼び出しと返却タイミングを記録 するもの • Dapper trace
は RPCをネストした tree 構造で構成さ れる
Trace trees and spans • Dapper trace tree は、ノードは基本的なユニッ トである
span である • span id と parent id • 全 span はtrace id に紐づく • 全IDはユニークな 64bit integer
Span詳細 • 2つ目の Helper.Call の各イベント • fooというannotationを挿入 • clock skew
に注意 ◦ クライアントはサーバーがリクエストを受信 する前に常にリクエストを送信し、サー バーの応答についてはその逆である
実装のポイント • a trace context ◦ span属性コンテナ • C++/Java の
RPC framework
Annotations • 開発者はトレースにアノテーションを挿 入できる ◦ 任意のコンテンツ • key-value 形式もサポート
Trace collection • 各spanは一度ローカルに保存され、その後中 央(googleだから、Bigtable)に送られる • 中央値は15秒未満。98パーセンタイルは2分未 満。(数時間掛かるものもある) • GoogleのエンジニアはリポジトリにAPI経由でも
アクセス可能 ◦ DAPI
Out-of-band trace collection • out-of-band にロギングとトレーシングされる • in-band collection では実現できない(RPCレスポンスヘッダを用いた実装)
◦ アプリケーションのネットワークダイナミクスに影響が大きい ◦ RPCがフルにネストしている前提になる
Dapper Runtime Library • Dapper RPC ◦ スパンの作成、サンプリング、ローカルディスクへのロギングなど • アプリに含まれるので、修正が困難
• C++ 1000行未満 • Java 800行未満 • key-value annotations 用には 500行のコードを加えている
トレース収集のオーバーヘッド • Dapperデーモンプロセスのトレース収集のCPU使用率は極めて少ない ◦ (1コアの)0.3%以上使われることはない ◦ kernel のスケジューラにおいて priority を可能な限り小さくしている
• ネットワークリソースも非常にライト ◦ 各スパンは平均426バイト ◦ Google のプロダクション環境において 0.01% 未満になるように抑えている
プロダクションワークロードへの影響 • サンプリングレートを変えながら本番ワークロード (Web search cluster)への影響を観察 ◦ スループット影響は大きくないが、レイテンシへの影響が大きい • 経験的には、high-volume
なサービスは 1/1024 あれば十分
Dapper Depot API, DAPI • トレースデータは regional Dapper repositories (Depots)
に格納される • Depot API, DAPI を使ってアクセスする ◦ Access by trace id ◦ Bulk access ▪ MapReduce向け ◦ Indexed access ▪ よく使われるアクセスパターンに基づく • 最もチャレンジング ▪ 元々はホストマシンorサービス名だったが、最終的にはホストマシン、サービス名、タイム スタンプの複合インデックスとした
DAPI usage within Google • DAPI使用分類 ◦ Webアプリ ▪ 3個
◦ コマンドラインツール ▪ 8個 ◦ on-off ツール ▪ 15-20個 ◦ それら以外はよくわからない
Dapper user interface
Dapper user interface サービスとタイムウィ ンドウを指定 +コストメトリック
Dapper user interface 実行パターン毎のパ フォーマンスサマリ ソートも可
Dapper user interface 特定の実行パターン の可視化(2で選択し たもの)
Dapper user interface パターンEの分布
Dapper user interface パターンEにおける各 サービスの振る舞い
Experiences Layered and Shared Storage Systems • Google における多くのストレージシステムは、複数のレイヤで構成されており、 多くのユーザでシェアされている
• Bigtable は Chubby と GFS を両方使用している ◦ Bigtable cell からのGFSトラフィックは、単一ユーザ or複数のユーザで使用されている可能性が あるが、GFSレベルでは、これら2つの異なる使用パターンの違いはわからない • Dapper UIは、実行パターンをグループ化できるため、ユーザをランク付けでき る
Other Lessons Learned • Google 社内利用での学び ◦ Coalescing effects ▪
トレースの処理単位を集約 ◦ Tracing batch workloads ▪ MapReduce のようなバッチワークロードにも有効 ▪ バッチ用には意味のある単位に紐付ける シャード IDなど ◦ Finding a root cause ▪ annotation を利用して、キューなどの具体的な情報を追加 ◦ Logging kernel-level information ▪ カーネルパラメータのスナップショットをスパンに紐付ける ▪ 調査中とのこと
まとめ • Googleの本番分散システムトレースプラットフォーム Dapper • ほとんどすべてのGoogleのシステムに導入されており、アプリケーションレベル の変更を必要とせず、パフォーマンスに目立った影響を与えることなく、最大の ワークロードの大部分を追跡可能 • Dapper
trace repositories を開発者に公開したことは大きなポイントだった