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
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
4.9k
パーソナライズPodcastを作った話
repunit11
0
120
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
350
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
350
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
190
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
230
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
480
Simple Storage Service(S3) is not simple
iwatsukayura
0
210
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
710
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
370
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
140
Featured
See All Featured
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
The untapped power of vector embeddings
frankvandijk
2
1.9k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
How to build a perfect <img>
jonoalderson
1
6.1k
Bash Introduction
62gerente
615
220k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
580
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
860
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
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 • 各サービスに責務を分けてシンプル化 • 分ける際は遅延反映や事前処理を検討 まとめ ※このシステム構成は私だけでなく、昔のチーム &今のチームで考えられたものです