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
10Xの検索を10xしたい at 第49回Elasticsearch勉強会
Search
Ryusuke Chiba
August 31, 2022
Technology
0
500
10Xの検索を10xしたい at 第49回Elasticsearch勉強会
Ryusuke Chiba
August 31, 2022
Tweet
Share
More Decks by Ryusuke Chiba
See All by Ryusuke Chiba
10Xの検索を10xしたい at 【10X/M3/CADDi】検索エンジン運用勉強会
metalunk
5
1.4k
プログラマのための線形代数 おまけ
metalunk
1
150
メルカリにおける AI 活用事例 PyCon JP 2018
metalunk
8
6.8k
メルカリの機械学習基盤 これまでとこれから ML Ops Study #2
metalunk
0
850
機械学習によるマーケット健全化 Mercari ML Ops Night #1
metalunk
3
5.4k
Other Decks in Technology
See All in Technology
品質文化を支える小さいクロスファンクショナルなチーム / Cross-functional teams fostering quality culture
toma_sm
0
180
Как мы автоматизировали интеграционное тестирование с Gonkey и не пожалели. Паша Егорычев, Кирилл Поляков
lamodatech
0
1.7k
Twelve-Factor-Appから学ぶECS設計プラクティス/ECS practice for Twelve-Factor-App
ozawa
3
160
エンジニアリングで組織のアウトカムを最速で最大化する!
ham0215
1
280
もう難しくない!誰でもカンタンDocker入門 〜30分であなたのPCにアプリを立ち上げる〜
devops_vtj
0
180
Simplify! 10 ways to reduce complexity in software development
ufried
1
200
PagerDuty×ポストモーテムで築く障害対応文化/Building a culture of incident response with PagerDuty and postmortems
aeonpeople
3
540
C++26アップデート 2025-03
faithandbrave
0
1.2k
Compose におけるパスワード自動入力とパスワード保存
tonionagauzzi
0
190
2025-04-24 "Manga AI Understanding & Localization" Furukawa Arata (CyberAgent, Inc)
ornew
2
330
【Oracle Cloud ウェビナー】ご希望のクラウドでOracle Databaseを実行〜マルチクラウド・ソリューション徹底解説〜
oracle4engineer
PRO
1
140
SREからゼロイチプロダクト開発へ ー越境する打席の立ち方と期待への応え方ー / Product Engineering Night #8
itkq
2
1.1k
Featured
See All Featured
A Tale of Four Properties
chriscoyier
159
23k
It's Worth the Effort
3n
184
28k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
Embracing the Ebb and Flow
colly
85
4.7k
Automating Front-end Workflow
addyosmani
1370
200k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
The Language of Interfaces
destraynor
157
25k
Fireside Chat
paigeccino
37
3.4k
A designer walks into a library…
pauljervisheath
205
24k
How to Ace a Technical Interview
jacobian
276
23k
Mobile First: as difficult as doing things right
swwweet
223
9.6k
Transcript
©10X, Inc. All Rights Reserved. 第49回 Elaticsearch 勉強会 10Xの検索を10xしたい @metalunk
1
©10X, Inc. All Rights Reserved. 2 10X が提供する Stailer の説明
チェーンストアECの垂直立ち上げプラットフォーム
©10X, Inc. All Rights Reserved. チェーンストアECの垂直立ち上げプラットフォーム Stailer 3 スーパーマーケットやドラッグストアの E-commerce
アプリ制作からオペレーションまで(詳しくは次のページ) インテグレータでなくプラットフォーム https://yamotty.tokyo/post/20220605 Smart retailer
©10X, Inc. All Rights Reserved. チェーンストアECの垂直立ち上げプラットフォーム Stailer 4
©10X, Inc. All Rights Reserved. 5 半年間で実施した検索改善
©10X, Inc. All Rights Reserved. 半年間で実施した検索改善 2022年1月からの半年間で取り組んだこと • Slow
query の解決(検索速度 10x) • Hardware profile の変更(コスト 80% 削減) • 検索キーワードサジェスト • カテゴリフィルタ • bigram • シノニム辞書を Search time に展開 • イベントログからシノニムルールの生成 今日は青字の部分だけ説明します 6 詳しくは https://product.10x.co.jp/entry/serch-10x https://product.10x.co.jp/entry/search-10x-ii
©10X, Inc. All Rights Reserved. 7 コスト 80% 削減 Hardware
profile の変更
©10X, Inc. All Rights Reserved. Hardware profile の変更(コスト 80% 削減)
背景 • Slow query を解消し,CPU usage 68% 減少,Query time 87% 減少し,リソースに余裕ができた 課題 • 負荷解消によって必要なリソースのバランスが変わり,適 切な Hardware profile を利用できていない(単に scale in しただけでは解決しない) 8
©10X, Inc. All Rights Reserved. Elastic Cloud の Hardware profile
Elastic Cloud の Hardware profile を変えることで Storage, RAM, vCPU のバランスを変えることが できる 現在利用できる profile は • Storage optimized • Storage optimized (dense) • General purpose • CPU optimized 9 Hardware profile の変更(コスト 80% 削減)
©10X, Inc. All Rights Reserved. 引っ越し計画 10 Hardware profile の変更(コスト
80% 削減) もともと I/O Optimized(RAM と Storage が大盛り)を 使っていたが,Stailer は CPU heavy なアプリケーショ ンであるため,CPU Optimized が適していることがわ かった 現状と同等の vCPU をもつ profile に変更すると 85万 円/月の節約ができそう! この節約はサービスが大きくなってスケールアウトす るときにさらに効く しかし,Hardware profile は Deployment 作成時にしか 設定できないため,あたらしく Deployment を作成し, 旧 Deployment から引っ越しをする必要がある 無停止,データロスなしで
©10X, Inc. All Rights Reserved. 引っ越しの方針 1. Elasticsearch の更新をすべて PubSub
経由にする 2. 新しい Deployment を CPU optimized で作る 3. Double write 開始 4. 旧 Deployment の全 index を新 Deployment に reindex 5. 参照を切り替える 6. Double write 停止 7. 旧 Deployment を停止,削除する 11 Hardware profile の変更(コスト 80% 削減)
©10X, Inc. All Rights Reserved. Step0 12 Hardware profile の変更(コスト
80% 削減) 1. Elasticsearch の更新をすべて PubSub 経 由にする 2. 新しい Deployment を CPU optimized で作 る 3. Double write 開始 4. 旧 Deployment の全 index を新 Deployment に reindex 5. 参照を切り替える 6. Double write 停止 7. 旧 Deployment を停止,削除する
©10X, Inc. All Rights Reserved. Step1 13 Hardware profile の変更(コスト
80% 削減) 1. Elasticsearch の更新をすべて PubSub 経 由にする 2. 新しい Deployment を CPU optimized で作 る 3. Double write 開始 4. 旧 Deployment の全 index を新 Deployment に reindex 5. 参照を切り替える 6. Double write 停止 7. 旧 Deployment を停止,削除する
©10X, Inc. All Rights Reserved. Step2, 3, 4 14 Hardware
profile の変更(コスト 80% 削減) 1. Elasticsearch の更新をすべて PubSub 経 由にする 2. 新しい Deployment を CPU optimized で作 る 3. Double write 開始 4. 旧 Deployment の全 index を新 Deployment に reindex 5. 参照を切り替える 6. Double write 停止 7. 旧 Deployment を停止,削除する
©10X, Inc. All Rights Reserved. Step5 15 Hardware profile の変更(コスト
80% 削減) 1. Elasticsearch の更新をすべて PubSub 経 由にする 2. 新しい Deployment を CPU optimized で作 る 3. Double write 開始 4. 旧 Deployment の全 index を新 Deployment に reindex 5. 参照を切り替える 6. Double write 停止 7. 旧 Deployment を停止,削除する
©10X, Inc. All Rights Reserved. Step6 16 Hardware profile の変更(コスト
80% 削減) 1. Elasticsearch の更新をすべて PubSub 経 由にする 2. 新しい Deployment を CPU optimized で作 る 3. Double write 開始 4. 旧 Deployment の全 index を新 Deployment に reindex 5. 参照を切り替える 6. Double write 停止 7. 旧 Deployment を停止,削除する
©10X, Inc. All Rights Reserved. Step7 17 Hardware profile の変更(コスト
80% 削減) 1. Elasticsearch の更新をすべて PubSub 経 由にする 2. 新しい Deployment を CPU optimized で作 る 3. Double write 開始 4. 旧 Deployment の全 index を新 Deployment に reindex 5. 参照を切り替える 6. Double write 停止 7. 旧 Deployment を停止,削除する
©10X, Inc. All Rights Reserved. Restore from snapshot 機能の不具合 Elastic
Cloud が提供している Restore from snapshot 機能で新 Deployment を作ろうとしたが動か ず... サポートに問い合わせるも特別な不具合とのことで,修正には時間がかかりそう(その後個別対応し てもらい,いまは動くはず) そういうわけで,代わりに Reindex from remote 機能を使ったツールを作ることにした ツールが行うことは,新しい Deployment に index を作り,mapping 等の設定をし,稼働中の Deployment から Reindex を実行すること 18 Hardware profile の変更(コスト 80% 削減)
©10X, Inc. All Rights Reserved. 成果 • コスト 80% 削減
• 将来スケールアウトするときにも省コスト • Elasticsearch の更新をすべて Pub/Sub 経由にできた ◦ 引っ越し可能 ◦ 耐障害性向上 19 Hardware profile の変更(コスト 80% 削減)
©10X, Inc. All Rights Reserved. 20 2022年1月からの半年間で取り組んだこと • Slow
query の解決(検索速度 10x) • Hardware profile の変更(コスト 80% 削減) • 検索キーワードサジェスト • カテゴリフィルタ • bigram • シノニム辞書を Search time に展開 • イベントログからシノニムルールの生成 今日説明できなかった改善事例はブログをご覧ください https://product.10x.co.jp/entry/serch-10x https://product.10x.co.jp/entry/search-10x-ii
©10X, Inc. All Rights Reserved. 21 いま取り組んでいる推薦
©10X, Inc. All Rights Reserved. いま取り組んでいる推薦 Stailer における商品の Discovery のうち,お客さまが能動的に探す検索はまあまあいい状態になっ
てきたから,次はお客さまに受動的に商品を見つけてもらいたい 22 • 初期リリースでは MLOps 部分をきっちり作り,モデルは簡単なもの(ε-greedy のバンディッ ト)を出す • MLOps を @metalunk, Data science を Growth チームの2人で担当 • 出したらまたどこかで発表します 推薦やるぞ!
©10X, Inc. All Rights Reserved. 23 10X のすゝめ
©10X, Inc. All Rights Reserved. 10X のいいところ10個あげます 1. メンバーが賢い.自律的 2.
心理的安全性が高い(Brilliant jerk がいない) 3. 経営陣が信頼できる 4. SO に夢が持てる 5. スタートアップなのにまあまあ高い給与水準 6. Stailer を作ることで世界をよくできる 7. 事業が成長している 8. 日本のどこに住んでもいい 9. フルリモート OK 10. 家族第一 24
©10X, Inc. All Rights Reserved. カジュアル面談しませんか? この通り,検索はまだ基本的なことしかやっておらず,やることはたくさんあります 検索エンジニアが入社したら活躍できる状態を作りました
どんな人に来てほしい? • Stailer の検索を 10x できる人 • 検索,推薦合わせて Discovery という大きい Issue をまるっとやるのも大歓迎 Job description はこちら: https://open.talentio.com/r/1/c/10x/pages/59532 まずはカジュアル面談お願いします!: https://meety.net/matches/VKrfjFMdjWsC 25