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
How to face the load
Search
Saki
March 27, 2022
Programming
300
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
How to face the load
学生団体Volareさんとの勉強会(
https://volare.connpass.com/event/238578/
)で発表した資料です
Saki
March 27, 2022
Other Decks in Programming
See All in Programming
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
610
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
630
ChromeでローカルLLM
ryu1013
0
140
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
610
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
140
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
110
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.1k
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
500
phperだってパンチカードでコーディングしたい
o0h
PRO
0
340
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
770
Featured
See All Featured
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
Documentation Writing (for coders)
carmenintech
77
5.6k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Visualization
eitanlees
153
17k
How to Talk to Developers About Accessibility
jct
2
580
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.4k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
450
A Tale of Four Properties
chriscoyier
163
24k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
280
Transcript
大規模な広告配信の仕組み pixiv 広告のシステム例 pixiv Inc. saki 2022.03.27
2 Profile • saki (@yensaki) • 経歴 ◦ - 2017:
カカクコム(食べログ) ◦ 2017 -: ピクシブ ▪ 2017 - 2019: pixivFACTORY ▪ 2019 - : 広告 • 好きな技術 ◦ Ruby on Rails ◦ Kubernetes saki ピクシブ株式会社 アドプラットフォーム事業部
3 発表の流れ 1. 広告の概要 2. インフラ構成 3. アプリケーション構成 4. 重要ポイント
4 1.広告の概要
5 ピクシブの広告規模 リクエスト数 • 月間500億件…超 ◦ 年々増えてる 広告の リクエスト種類とは •
広告取得 • rendering通知 • クリック • コンバージョンなど https://www.wantedly.com/companies/pixiv/post_articles/283162
広告配信のフロー 6 広告配信サーバーから JavaScriptを取得 &実行して広告を描画
広告配信のフロー: 広告リクエスト 7
広告配信のフロー: rendering完了通知 8 impressionとして受領 (本当は画面内に表示されたことも計測するなどもう少し考えることはある )
広告配信のフロー: クリック遷移 9
10 データ登録やレポートなどのビジネスを支える管理画面 裏側には管理画面
11 これから紹介するもの 移行途中のものもあるので、実際の構成の中から クラウドを中心とした構成を紹介します
12 2. インフラ構成
13 アーキテクチャ
14 GKE(Google Kubernetes Engine) 広告配信サーバー・管理画面はGKE上
15 GKE(Google Kubernetes Engine) 「サーバーレス化できたほうが楽では?」 → GKE(GCE)のEgressはCloud Runより省費用 広告配信の特徴によるもの •
リクエスト数が多い • リクエストあたりのサイズが小さい
16 pximg • pixivのイラスト配信に使われているもの ◦ 画像変換と高速配信を両立できる • なぜCDNではない? ◦ 広告用画像の要件を満たしつつ
費用減が両立可能 ◦ 管理コストもほぼ増えない https://www.sakura.ad.jp/services/imageflux/image/ 使ってみたい方はこちらをご検討ください
17 配信ログ集積 • 配信サーバーからCloud Loggingに送信 ◦ BigQueryにexport • BigQuery上で加工してDBにレポート記録 •
BIツールでの分析にも活用 • 蓄積データ ◦ 1日100GB超
18 3.アプリケーション構成
19 広告配信サーバー • Golang + echo • Pod: ◦ 70〜200(移行途中の分も含む)
• レイテンシ: ◦ 〜20ms • リクエスト処理: ◦ 最大300万件/min
20 管理画面 • Ruby on Rails ◦ CRUDをベースにした管理画面 ◦ 社内にはRailsサービスが多い
• Pod: 2件前後
21 バッチ • Argo Workflow • Rails rakeタスクがメイン • DB,
Redis, BigQueryに対してアクセス・更新
22 4. 重要ポイント
23 データ反映 • 配信サーバーはDBを参照しない ◦ DBクエリでは遅くなるため ◦ その分、反映時間は0秒ではない ▪ バッチ実行間隔とキャッシュクリアに依存
24 シンプル化 • 配信サーバーは責務に集中 ◦ 高速な大量配信 • そのために他の要素は完全分離 ◦ 管理画面
◦ CTR予測 ◦ ログ集計
25 まとめ
26 • 各サービスに責務を分けてシンプル化 • 分ける際は遅延反映や事前処理を検討 まとめ ※このシステム構成は私だけでなく、昔のチーム &今のチームで考えられたものです