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
回首過去_看_KKBOX_怎麼走搜尋音樂這條路.pdf
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Eason Chen
August 11, 2018
Technology
320
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
回首過去_看_KKBOX_怎麼走搜尋音樂這條路.pdf
Eason Chen
August 11, 2018
More Decks by Eason Chen
See All by Eason Chen
使用 Grafana + Prometheus 打造視覺化監控平台
jhihming
1
320
Other Decks in Technology
See All in Technology
サブエージェントと Claude Mods で作る独自 Advisor ツールの話
kenichiodo
2
170
トークン化預金DCJPYの取り組みと活用ユースケース
finengine
0
160
10年後、Engineering 行為を剥奪されるとして、わたしたちは、どう、何を創ればいいだろうか。 / If Engineering Is Taken Away in 10 Years, How and What Should We Create?
bitkey
PRO
1
200
AI × アーキテクト 第1・2章|生成AIの課題とアーキテクトの素養
daidaidai
0
180
パッチ更新でterraform initが落ちた日
grimoh
1
140
AI導入は済んだ。次は統制を作り替える番だ_AI×開発組織 Summit 2026
techtekt
PRO
0
360
DBについての基礎説明(MySQL編) - コロプラ 2026年度 新卒研修
colopl
0
130
大型犬好きによるPugの紹介
yamanoku
1
160
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
290
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
120
⾮構造化データを価値に変える AI エージェント基盤とその組織
ivry_presentationmaterials
0
200
PHPカンファレンス関西の招待状 / Invitation to PHP Conference Kansai
ykanoh
0
210
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
1.6k
Believing is Seeing
oripsolob
1
250
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Unsuck your backbone
ammeep
672
58k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
sira's awesome portfolio website redesign presentation
elsirapls
0
460
How to Think Like a Performance Engineer
csswizardry
28
2.9k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
360
A Soul's Torment
seathinner
8
3.8k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
400
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
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