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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Tatasuro Hisamori
September 21, 2013
Technology
3.5k
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
こんなアーキテクチャ図は嫌だ BEYOND THE TIME: 半年後の自分へ贈る15のメッセージ / 15 of Anti-pattern in AWS Architecture Diagrams
naospon
3
300
OpenTelemetryのメトリクスをCloudWatchに送ってPromQLで見てみた
ota1022
0
120
深夜のクラウド懺悔室 1:29:300 or 1:0:0
kazzpapa3
1
230
Amazon S3 Tablesに全部任せてみた結果——コンパクション/スナップショット管理は本当に手放せるか
shigeruoda
1
460
Tab5をRubyで動くパソコンにする
kishima
2
280
Webとヘルスデータ
yukukotani
1
320
AIに丸投げしないトイル削減 / Eliminating Toil Without Leaving It All to AI
kohbis
4
1.1k
Code4Lib JAPANカンファレンス2026 開会挨拶 / Code4Lib JAPAN Conference 2026: Opening Remarks
ykiyota
0
310
OpenTelemetry eBPF Instrumentationの舞台裏 / Behind the Scenes of OpenTelemetry eBPF Instrumentation
ymotongpoo
3
930
DEFCON34-Write-up_HYCu-MYCu
daikiokazaki
0
140
AIとペアプロを始める。人とのペアプロをやめる。ペアプロの良さを改めて知る。もっと好きになった。 / Rediscovering Pair Programming
honyanya
1
330
リージョンの壁を越える、 ちょっと変わったAWSサービスの話
falken
PRO
1
300
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
6.2k
Practical Orchestrator
shlominoach
191
12k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
490
Mobile First: as difficult as doing things right
swwweet
225
10k
Test your architecture with Archunit
thirion
2
2.4k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
WENDY [Excerpt]
tessaabrams
12
39k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
560
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
240
Joys of Absence: A Defence of Solitary Play
codingconduct
1
500
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
470
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ʹӡ༻Λམͱ͠ࠐΊΔ • ՝Λࠀͯ͠ɺΑΓ҆৺͔ͯͭ͑͠ΔΑ͏ʹ ͍͖͍ͯͨ͠͠ɺͦͷϊϋΛڞ༗͍ͨ͠ ͜͜·Ͱͷ·ͱΊ