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
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
freeeにおけるSoftware Factory
freee
PRO
0
260
AIをリアル世界に解き放つ 〜M5Stack×AIであなたのアイディアを手の平に〜
hamadakoji
1
200
OptunaHub: ブラックボックス最適化のためのプラットフォーム
pfn
PRO
0
150
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
7
5.2k
スプシの手作業からの解脱 ~更新はClaude Codeに、見せ方と使い方はGASアプリに任せる~
kentarofujii
0
170
AI駆動で「他アプリの音を加工できる」アプリを作った
satomasahiro2005
0
190
コンテナ運用におけるネットワーク・コンテナコストの削減方法/How to Reduce Network and Container Costs in Container Operations
masakiokuda
2
370
Post AI時代のリファクタリング実践記 / Refactoring in the post AI era
kaminashi
1
320
Local CI × GitHub Actions
gogutan
3
260
AI駆動開発におけるハーネスエンジニアリングの勘所
tsukuboshi
1
330
AIネイティブ企業への変革。パーソルキャリアが挑む「データメッシュ×ガバナンス」のアーキテクチャ戦略
techtekt
PRO
0
120
AI駆動開発における開発環境のセキュリティの考え方
yamahiro
0
200
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
55
13k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
570
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
330
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
610
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
760
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
530
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ʹӡ༻Λམͱ͠ࠐΊΔ • ՝Λࠀͯ͠ɺΑΓ҆৺͔ͯͭ͑͠ΔΑ͏ʹ ͍͖͍ͯͨ͠͠ɺͦͷϊϋΛڞ༗͍ͨ͠ ͜͜·Ͱͷ·ͱΊ