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
More Decks by Saki
See All by Saki
Kaigi on Rails 2026 After Event from ピクシブ LT saki
yensaki
0
27
Other Decks in Programming
See All in Programming
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
160
残高管理から台帳サービスへの進化
artoy
1
220
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
4
1.1k
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
11
6.8k
Modernizing iOS Apps
seyfoyun
0
120
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.9k
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
140
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
610
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
190
Next.js: The final boss of Web Performance
guaca
0
350
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
150
contenteditable と日本語入力に向き合う
colorful12
0
220
Featured
See All Featured
We Are The Robots
honzajavorek
0
410
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
59k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
470
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Skip the Path - Find Your Career Trail
mkilby
1
260
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
580
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
460
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
740
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Designing for Timeless Needs
cassininazir
1
530
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
370
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 • 各サービスに責務を分けてシンプル化 • 分ける際は遅延反映や事前処理を検討 まとめ ※このシステム構成は私だけでなく、昔のチーム &今のチームで考えられたものです