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
回首過去_看_KKBOX_怎麼走搜尋音樂這條路.pdf
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Eason Chen
August 11, 2018
Technology
1
310
回首過去_看_KKBOX_怎麼走搜尋音樂這條路.pdf
Eason Chen
August 11, 2018
Tweet
Share
More Decks by Eason Chen
See All by Eason Chen
使用 Grafana + Prometheus 打造視覺化監控平台
jhihming
1
310
Other Decks in Technology
See All in Technology
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1.7k
配列に見る bash と zsh の違い
kazzpapa3
3
170
猫でもわかるKiro CLI(セキュリティ編)
kentapapa
0
130
Bedrock PolicyでAmazon Bedrock Guardrails利用を強制してみた
yuu551
0
260
SchooでVue.js/Nuxtを技術選定している理由
yamanoku
3
210
AIエージェントに必要なのはデータではなく文脈だった/ai-agent-context-graph-mybest
jonnojun
1
250
Codex 5.3 と Opus 4.6 にコーポレートサイトを作らせてみた / Codex 5.3 vs Opus 4.6
ama_ch
0
220
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
93k
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
530
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.2k
SREチームをどう作り、どう育てるか ― Findy横断SREのマネジメント
rvirus0817
0
360
pool.ntp.orgに ⾃宅サーバーで 参加してみたら...
tanyorg
0
1.4k
Featured
See All Featured
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
450
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
250
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
170
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
HDC tutorial
michielstock
1
400
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
How to train your dragon (web standard)
notwaldorf
97
6.5k
WENDY [Excerpt]
tessaabrams
9
36k
Designing for Timeless Needs
cassininazir
0
130
Transcript
回首過去 看 KKBOX 怎麼走搜尋音樂這條路 Eason Chen 2018/08/11
Agenda • 現況 • 使用者體驗改善 • 機器配置 • 系統升級 •
監控平台 • 踩坑全記錄
None
欸,有沒有免費帳號來一下?
KKBOX 不就播歌而已 你在裡面做什麼?
$149起
你們號稱有 4000 萬首歌曲 為什麼找不到這首?
KKBOX 有哪些地方用到搜尋?
None
None
None
None
CMS 後台
KKBOX Open API
None
None
https://www.kube-app.com
None
None
None
音樂曲庫資料量 • 4000 萬首歌曲 • 700 萬張專輯 • 200 萬位歌手
• 900 萬張歌單
如何提供 快穩準 的音樂搜尋
在 2014 年開始使用 Elasticsearch
比較 Solr 和 Elasticsearch Solr 3.5 Elasticsearch 1.6 架構 Master-Slave
Cluster 配置 需要預先在 XML 檔案設定 直接透過 RESTful API 設定 功能 著重於文本搜尋 也支援資料分析 社群 發展成熟 成長中
還是老闆的一句話
使用
MeCab 支援日文搜尋 • 問題:日本習慣輸入羅馬拼音搜尋歌手 • 解決方案 ◦ 漢字 => 五十音
=> 羅馬拼音 ◦ 字典:Mecab-ipadic-neologd
OpenCC 支援繁簡轉換 • 問題:星馬地區習慣輸入簡體 • 解決方案 ◦ 一律轉為台灣繁體
容錯搜尋處理 • 問題:英文容易拼錯 • 解決方案 ◦ Term Suggester 根據編輯距離找出和 關鍵字相近的字串
◦ 指定 index 放在同一個 shard
優化 Autocomplete 回應時間 Edge ngram Context Suggester 實做方法 周杰倫 ➔
周、周杰、周杰倫 FST (Finite State Transducer) 實測秒數 15.85 ms 5.8 ms
資料處理 小寫字母 ASCII 原型詞根 Dash 縮寫符號 表情符號 Token Filter /
LIbrary lowercase asciifolding porter_stem word_delimiter emojione 案例 Mayday mayday Jóhann Jóhannsson Johann Johannsson apples apple A-Lin a lin alin grinning
None
配置
None
Node 1 (M) Node 2 Node 2 (M) Split Brain
None
None
升級
CI / CD • 測試不同環境的程式行為 • 自動化檢測 安裝套件 語法檢查 單元測試
整合測試 Coverage
2014/06 開始使用 ES 1.6 2017/10 升級 ES 2.4 2018/03 升級
ES 5.6
升級計畫 • 功能測試 • Client 平行轉換 • 壓力測試
備援計畫
升級效益 • CPU 使用量減少 25% • JVM 最大值從 31G 下降到
24G • API 平均回應時間從 222ms 下降到 192ms • Index 更新時間縮短 33%
為什麼沒有繼續往上升到 6.x?
監控
Munin
Munin to Kibana Munin Kibana + Marvel 性能指標豐富 勝 介面操作容易
勝 資料來源穩定 勝
Kibana vs Grafana Kibana Grafana 資料來源 Elasticsearch Prometheus + Elasticsearch
Exporter
Grafana - Template 功能
None
None
None
https://grafana.com/dashboards/7259
https://github.com/KKBOX/grafana-elasticsearch-dashboard
踩坑全記錄
12:47 Server 5 沒有回應 Cluster Health 亮紅燈 12:48 Server 5
離開 Cluster Shard 重新分配 Server 4 接手歌單 Shard Server 4 忙碌到沒有回應 12:49 Server 4 離開 Cluster Shard 再度重新分配
事發當下 Server 5 的 Swap 變化 隔天 Server 1 短暫離開
Cluster 的 Swap 變化 Swap Issue
Swap Issue • 解決方案 ◦ vm.swappiness 設為 0 ◦ unmount
swap partition
• 問題:某些機器 CPU 使用率特別高 • 追蹤:跟索引文件的分配方式有關 • 解決方案 ◦ 人工
Sharding 介入調整 ◦ 重構歌曲和歌單的 Query 機器負載分布不均
搜尋效能下降 • 問題:機器運行一段時間後,搜尋效能下降 • 追蹤 ◦ GC 的花費時間,隨著 JVM 運行越久而不斷上升
◦ Groovy 有 Memory Leak Issue
None
None
Q & A
強大的應用來自背後偉大的資料! KKBOX Open API 為什麼讓開發者紛紛入坑? 快快掃, 別錯過!
101 國際會議廳 門口 講 台 門口 展覽A區 校園側門 (入口2) 基隆路
大門 (入口1)
THANK YOU