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
Perl and Riak
Search
Tatasuro Hisamori
September 21, 2013
Technology
3.6k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Perl and Riak
Tatasuro Hisamori
September 21, 2013
Transcript
20 slides
1FSMBOE3JBL 3JBLΛ1FSM͔ΒരͰҎԼུ :"1$"TJBl1FSMBOE3JBLz
.FNDBDIFEϓϩτίϧޓϓϩμΫτͷ࣋ͭ՝ 1FSMBOE3JBL
<5PLZPc,ZPUP> Perl and Riak
• 性能 • [Tokyo|Kyoto] [Tyrant|Tycoon] は高速 • 50ms
or die. を支えるためには速度が必要 • スケーラビリティ • クライアントサイドで分散内容決まる => スケールしにくい • 「10台じゃ足りない!! 11台目を追加しよう」が簡単にできない • 運用 • 通常運用では高負荷な状況でも実績がある • データ検索したりできない(踏み込んだデータ活用に難有) <5PLZPc,ZPUP><5ZSBOUc5ZDPPO>ͷ՝ Perl and Riak
• 35#ʹɺ"VEJFODFใΛେྔʹੵɺ ׆༻ՄೳͳࢄσʔλετΞ͕ඞཁ • Ωʔͷ͕͡ΌΜ͡ΌΜ૿͍͑ͯͨ͘Ίɺε έʔϥϏϦςΟͷ֬อ͕՝ • ͜ΕΒͷ՝ʹ3JBL͕ҰఆͷճΛͨΒ ͢ͷͰͱظ͍ͯ͠Δ ͜͜·Ͱͷ·ͱΊ
Perl and Riak 1FSMBOE3JBL
• Perl • アプリケーションはほぼ全て Perl • Perl <-‐>
Riak のやり取りを受け持つモジュールが必要 • KVS • 既存の TT/KT へのアクセスは Cache::Memcached::Fast • Memcached クライアントを使っている • 運用 • メトリクス収集 -‐> CloudForecast • 監視 -‐> Nagios 'SFBL0VUͷγεςϜ Perl and Riak
• Riak Client for Perl • Net::Riak, Riak::Light, Data::Riak,
AnyEvent::Riak • REST だけ or PurePerl の Protobuf サポート • 残念ながら遅い • Memcached クライアントとインターフェース互換がない • 既存の処理に組み入れにくい • ないなら作るしかない • Riak::PBC <-‐ Protobuf のオブジェクト • Riak::Lite::PBC <-‐ 実際に Riak とやり取りする client Perl and Riak 1FSMͱ3JBL
• その他のモジュールとの比較 • https://gist.github.com/myfinder/5232845 • 結果
• 3000% over faster • 現状 Perl の世界では(たぶん)最速 • memcached like interface • Cache::Memcached::Fast 使ってる人には使いやすい Perl and Riak ࡞ͬͨNPEVMFͷੑೳ
• Test::riak • https://github.com/myfinder/p5-‐test-‐riak • 動作
• テスト実行時に、空きポートを bind して Riak を起動 • テスト終了時に、Riak を終了してくれる • テスト重要 • 継続的に運用していくシステムにおいて”テストができる”こ とはマスト要件 Perl and Riak ୯ମςετϞδϡʔϧ
՝ Perl and Riak
3JBLͦͷ··Ͱ ݱঢ় ੑೳෆ Perl and Riak
• Redirect がつらい • haproxy で分散しているので、redirectが起こりやすい • スループットが上がらない
• Set が詰まるとつらい • Set が詰まり始めると、worker の busy 率が上がる • 書き込みの非同期化が必要 • 更に踏み込んだ対策が必要 • ハードウェア / ソフトウェア 両面から Perl and Riak ՝
• SSD 必須 & RAM もできるだけ多く • 必然的にRandomAccessの多いKVSでHDDはNG
• ネットワーク機器 / 構成を取る • 内部通信が増えるので、耐えられる構成にする Perl and Riak εϧʔϓοτ্ͷͨΊʹ
• キャッシュ層を設ける • hot な key については memcached
に任せる • データの origin を Riak に持つ • -‐> 実装済み Perl and Riak εϧʔϓοτ্ͷͨΊʹ app Riak Riak Riak Riak Riak Riak app app Riak Riak memd haproxy
• hash から partition を特定する • Riak の持っている partition
情報を RPC 経由で取得 • bucket / key から hash を取得して、収容 partition を特定 • @itawasa++ • partition に所属するノードに直接getしに行く • Riak::Lite::PBC でサポート予定 • -‐> 今後の課題 だった… Perl and Riak εϧʔϓοτ্ͷͨΊʹ
՝lͩͬͨz Perl and Riak
μΠίʔϯ࣌ͷ౸དྷ Perl and Riak
• Memcached interface local proxy • https://github.com/kuenishi/dicorn
• Memcached ProtocolでRiakとやりとりが出来る • こちらにcontributeしたほうが筋が良さそう • Cache::Memcached::Fast がそのまま使える Perl and Riak μΠίʔϯʁ
• ૉͷ··ͰNTPSEJFతʹݫ͠Ί • ߏͷ͕ඞཁ • ୠ͠εϧʔϓοτΛ্͛Δख͋Δ • εέʔϥϏϦςΟͷΛࠀͰ͖ΔϝϦο τେ͖͍ •
zαʔόΛ͚ͩ͢zʹӡ༻Λམͱ͠ࠐΊΔ • ՝Λࠀͯ͠ɺΑΓ҆৺͔ͯͭ͑͠ΔΑ͏ʹ ͍͖͍ͯͨ͠͠ɺͦͷϊϋΛڞ༗͍ͨ͠ ͜͜·Ͱͷ·ͱΊ
More Decks by Tatasuro Hisamori
See All by Tatasuro Hisamori
両面どころかインフラもTSでできるよ ~ 全方位TypeScriptによるプロダクト開発 ~
myfinder
11
5k
full test also want to end within 50ms
myfinder
11
7.8k
Other Decks in Technology
See All in Technology
2026-11-11 Tamachi.sre#7 PaCにインフラリソースの命を救われました。 / PaC saves the infra resource life
masasuzu
0
170
_マネジメントする人される人ナイト_2026__良いチームを作っていきたい_お気持ち_.pdf
xkxaxkx
0
270
LLM 基盤と kagent v0 を全部 k8s に入れてみた / Deploy both LLM and kagent v0 in k8s
kota2and3kan
0
210
Kiro IDE 入門 (画面の各部から、頼み方、任せ方、戻し方まで) | 目指せ Kiro マスター 02
inariku
PRO
4
240
The Author Pays
hiccupps
0
210
マネジメントされる側の仕事は「文句」を言うこと
riyaamemiya
3
1.9k
会社説明資料_最新版
demaecan
0
32k
An Introduction to Context Ontology Accelerator (teaching AI agents what your data means)
inariku
PRO
1
250
属人化したISMS運用をGitHubとAIで仕組み化した1年間の記録
sioncojp
4
2.6k
Quick Automate | 目指せ Quick マスター 12
inariku
PRO
1
110
これからのデータエンジニアの役割について考える / Rethinking the Role of Data Engineers in the AI Era
okiyuki99
0
490
「任されビリティ」で引き受けて「よしなりてぃ」に頼らず任せる / Accept tasks with "makasarebility" and hand them over without relying on "yoshinarily"
pauli
0
530
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
41k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
How to make the Groovebox
asonas
2
2.6k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.2k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
How GitHub (no longer) Works
holman
316
150k
Utilizing Notion as your number one productivity tool
mfonobong
4
640
Code Reviewing Like a Champion
maltzj
529
40k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
The Curious Case for Waylosing
cassininazir
1
610
Marketing to machines
jonoalderson
1
6k