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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
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.7k
Other Decks in Technology
See All in Technology
Benchmarking Disaggregated Serving on vLLM + Dynamo with a Real Coding-Agent Workload
nttcom
1
180
Kiro Crewをはじめよう
kizawa2020
1
150
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
720
分析の民主化を支えるメタデータ整備の実践
kakehashi
PRO
4
1.4k
オントロジーって 結局なにもの? AI エージェントに「意味」を渡す知識設計の話
greenmidori
0
130
10年後、Engineering 行為を剥奪されるとして、わたしたちは、どう、何を創ればいいだろうか。 / If Engineering Is Taken Away in 10 Years, How and What Should We Create?
bitkey
PRO
1
180
初対面のメンバーがチームを組み、Claude Codeでゼロからサービスをリリース
mkdev10
1
130
Optunaの最新リリースv5.0について
pfn
PRO
0
110
Classmethod Company Deck
satoshi7
1
600
TinyGoでオブザーバビリティ?OpenTelemetryはTinyGoで使えるのか / Is OpenTelemetry available in TinyGo environment?
ymotongpoo
2
140
Refining Active Record
shugo
0
140
Railsで挑む大量データ永続化 〜600億件を永続化するための設計とボトルネックとの戦い〜
occhi
1
550
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1369
210k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Visualization
eitanlees
153
17k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Designing for Performance
lara
612
70k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
620
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
600
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.4k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
640
Amusing Abliteration
ianozsvald
1
340
Transcript
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ʹӡ༻Λམͱ͠ࠐΊΔ • ՝Λࠀͯ͠ɺΑΓ҆৺͔ͯͭ͑͠ΔΑ͏ʹ ͍͖͍ͯͨ͠͠ɺͦͷϊϋΛڞ༗͍ͨ͠ ͜͜·Ͱͷ·ͱΊ