SlideShare uma empresa Scribd logo
1 de 33
Baixar para ler offline
Tokyo Tyrant + PHP

    小山健一郎
Agenda
   • About Me
   • About Tokyo Tyrant
   • Tokyo Tyrant + PHP
   • Simple Benchmark




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   2
About Me




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   3
About Me
   • name:
       –小山健一郎 (id:k1LoW)
        •from Fukuoka
   • type:
       –PHPer, CakePHP baker, Emacser
   • membership:
     –Fusic Co.,Ltd
           • >> http://fusic.co.jp
       –codecheck.in
          • >> http://trac.codecheck.in
   and 101000code / 3rdSTONE


PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   4
PHPといえば*AMP
                             PHP = *AMP?




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   5
PostgreSQL




     ちなみに私はLAPPが好きです
                               I like LAPP




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   6
RDBMもいいけれど
     key/value型DBMも使ってみたい!
                                 I like RBMS.
                    But,I want to use key/value DBM too.




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.      7
About Tokyo Tyrant




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   8
Tokyo Tyrant (TT)
   • Tokyo Tyrant is network interface of Tokyo
     Cabinet (key/value DB library)
           –   http://tokyocabinet.sourceforge.net/tyrantdoc/




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.           9
Tokyo Tyrant (TT)
   • Tokyo Cabinet (TC)というkey/value型DBMの
     ネットワークインターフェース
       – Author:平林幹雄氏
       – http://tokyocabinet.sourceforge.net/tyrantdoc/


   • mixiの「最終ログイン」などを管理(しているらしい)
       – ↑ユーザがアクセスするたびに更新されるという高負荷


   • TCP/IP上からバイナリプロトコルで接続可能
       – memcachedのプロトコルにも対応
       – HTTP互換
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.     10
PHPからTokyo Tyrantを使いたい!
                 I want to use Tokyo Tyrant with PHP!




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   11
Tokyo Tyrant + PHP




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   12
Tokyo Tyrant + PHP
   TT+PHPを実現するInterfaceや
    PHP Extensionは見つけているも
      のだけで4つ
       –TT独自バイナリプロトコルを扱うもの
        のみ
       –memcached互換のものは今回は除く



PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   13
Net_TokyoTyrant




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   14
Net_TokyoTyrant
   • Author
       –個々一番氏(id:cocoiti)
   • feature
       –PurePHPライブラリ
       –Openpearにてリポジトリ管理
           • http://openpear.org/package/Net_TokyoTyrant

       –PurePHPとして最適化されている
       –おそらく最も有名(だと思う)
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.      15
インストール
                                 Install




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   16
$sudo pear install openpear/Net_TokyoTyrant-beta




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   17
簡単
                                 Easy




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   18
php-tokyo_tyrant
   • Author
       –Mikko Koppanen氏 (mkoppanen)
   • feature
       –PHP Extension
       –PECLに登録されている
         • PHP Manualもある
       –GitHubにてリポジトリ管理
           • http://github.com/mkoppanen/php-tokyo_tyrant/tree/
             master
       –最も活発に開発が進んでいる
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.             19
インストール
                                 Install




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   20
$sudo pecl install tokyo_tyrant-beta




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   21
簡単
                                 Easy




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   22
dbo_tokyo
   • Author
       –Martin Samson氏 (masom)
   • feature
       –Datasource for CakePHP
        thechawにてリポジトリ管理
           • http://thechaw.com/tokyotyrant_datasource




                               ※#cakephp@irc.codecheck.in:6667で
                               id:cakephperさんに教えてもらいました

PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.             23
tokyotyrant_php
   • Author
       –俺
   • feature
       –tokyotyrant.rbに、できるだけ近づけ
        た実装を目指している
       –Net_TokyoTyrantを参考に作成
         • Fork?
       –GitHubにてリポジトリ管理
           • http://github.com/k1LoW/tokyotyrant_php/tree/master
       –最もβ、むしろα

PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.              24
Simple Benchmark




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   25
※参考程度に考えてください
                          It's very simple ^^;




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   26
PHPなのでhttp://で
                  アクセスしてみた
                   Simple HTTP Access Benchmark




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   27
Simple Benchmark
   • 単純にApache Benchで計測して
     みた               ランダムなkeyで
                                                        クエリ発行
                     ab –n 1000 – c 100




                                         •Apache
     対象データ:
     sha1($i)をkey、$iをvalueとした            •mod_php
     1,000,000レコード
                                         •DBM
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.           28
1アクセス1クエリ
                                ※Request/sec相対
                           1 access 1 query




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   29
1アクセス1クエリ




Net_TokyoTyrant           dbo_tokyo                  MySQL   plane html
           php-tokyo_tyrant        tokyotyrant_php


                                                ※Request/sec相対
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.                 30
1アクセス100クエリ
                                ※Request/sec相対
                          1 access 100 query




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   31
1アクセス100クエリ



                                                         !



Net_TokyoTyrant           dbo_tokyo                  MySQL   plane html
           php-tokyo_tyrant        tokyotyrant_php


                                                ※Request/sec相対
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.                 32
まとめ
   • Tokyo Tyrant + PHPの紹介をしま
     した。
   • php-tokyo_tyrantが最も高速
           –   php-tokyo_tyrant = very fast

   • PurePHPならNet_TokyoTyrant
           –   Net_TokyoTyrant = Nice PurePHP library

   • CakePHPならdbo_tokyo
           –   dbo_tokyo = CakePHP use

   • tokyotyrant_phpは…?
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   33

Mais conteúdo relacionado

Destaque

Destaque (16)

Fantasticno
FantasticnoFantasticno
Fantasticno
 
CakePHPゆとり開発環境
CakePHPゆとり開発環境CakePHPゆとり開発環境
CakePHPゆとり開発環境
 
Yet Another Plugins
Yet Another PluginsYet Another Plugins
Yet Another Plugins
 
Fukuoka Emacs #X02
Fukuoka Emacs #X02Fukuoka Emacs #X02
Fukuoka Emacs #X02
 
Emacs Lisp 紹介
Emacs Lisp 紹介Emacs Lisp 紹介
Emacs Lisp 紹介
 
Fantasticno W
Fantasticno WFantasticno W
Fantasticno W
 
Nature
NatureNature
Nature
 
はじめてのanything-c-source-*
はじめてのanything-c-source-*はじめてのanything-c-source-*
はじめてのanything-c-source-*
 
Jessie's 60th
Jessie's 60thJessie's 60th
Jessie's 60th
 
anything-php-funcref-perl.el
anything-php-funcref-perl.elanything-php-funcref-perl.el
anything-php-funcref-perl.el
 
for JSDeferred Code Reading
for JSDeferred Code Readingfor JSDeferred Code Reading
for JSDeferred Code Reading
 
CakePHP DB Schema/Model Info Plugin
CakePHP DB Schema/Model Info PluginCakePHP DB Schema/Model Info Plugin
CakePHP DB Schema/Model Info Plugin
 
A dash of creativity
A dash of creativityA dash of creativity
A dash of creativity
 
git-svn intro
git-svn introgit-svn intro
git-svn intro
 
実"戦"CakePHP Plugin
実"戦"CakePHP Plugin実"戦"CakePHP Plugin
実"戦"CakePHP Plugin
 
CakePHP Console Application 拡張Tips
CakePHP Console Application 拡張TipsCakePHP Console Application 拡張Tips
CakePHP Console Application 拡張Tips
 

Semelhante a Tokyo Tyrant + PHP

Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 Tokyo
Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 TokyoCorporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 Tokyo
Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 TokyoYusuke Kawasaki
 
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...devsumi2009
 
20090214 Phpstudy
20090214 Phpstudy20090214 Phpstudy
20090214 PhpstudyYusuke Ando
 
Linguagens Dinamicas - Tech Days 2008
Linguagens Dinamicas - Tech Days 2008Linguagens Dinamicas - Tech Days 2008
Linguagens Dinamicas - Tech Days 2008Alcides Fonseca
 
Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Ivo Jansch
 
Microblogging via XMPP
Microblogging via XMPPMicroblogging via XMPP
Microblogging via XMPPStoyan Zhekov
 
Hoppyではじめよう!リアルタイムweb
Hoppyではじめよう!リアルタイムwebHoppyではじめよう!リアルタイムweb
Hoppyではじめよう!リアルタイムwebtakeshi miki
 
PHPで文字コードとエラーメッセージをコントロールする
PHPで文字コードとエラーメッセージをコントロールするPHPで文字コードとエラーメッセージをコントロールする
PHPで文字コードとエラーメッセージをコントロールするSotaro Omura
 
Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...Combell NV
 
Pylons + Tokyo Cabinet
Pylons + Tokyo CabinetPylons + Tokyo Cabinet
Pylons + Tokyo CabinetBen Cheng
 
Yakiniku(焼き肉) on the Cloud
Yakiniku(焼き肉) on the CloudYakiniku(焼き肉) on the Cloud
Yakiniku(焼き肉) on the CloudTakao Funami
 
Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Ivo Jansch
 
How To Create Custom DSLs By PHP
How To Create Custom DSLs By PHPHow To Create Custom DSLs By PHP
How To Create Custom DSLs By PHPAtsuhiro Kubo
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)Stefan Koopmanschap
 
yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909Yusuke Wada
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
2007 0822 Antelope Php
2007 0822 Antelope Php2007 0822 Antelope Php
2007 0822 Antelope Phpgmaxsonic
 
第1回PHP拡張勉強会
第1回PHP拡張勉強会第1回PHP拡張勉強会
第1回PHP拡張勉強会Ippei Ogiwara
 

Semelhante a Tokyo Tyrant + PHP (20)

Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 Tokyo
Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 TokyoCorporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 Tokyo
Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 Tokyo
 
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
 
20090214 Phpstudy
20090214 Phpstudy20090214 Phpstudy
20090214 Phpstudy
 
Linguagens Dinamicas - Tech Days 2008
Linguagens Dinamicas - Tech Days 2008Linguagens Dinamicas - Tech Days 2008
Linguagens Dinamicas - Tech Days 2008
 
Ribbit
RibbitRibbit
Ribbit
 
Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008
 
Microblogging via XMPP
Microblogging via XMPPMicroblogging via XMPP
Microblogging via XMPP
 
Hoppyではじめよう!リアルタイムweb
Hoppyではじめよう!リアルタイムwebHoppyではじめよう!リアルタイムweb
Hoppyではじめよう!リアルタイムweb
 
PHPで文字コードとエラーメッセージをコントロールする
PHPで文字コードとエラーメッセージをコントロールするPHPで文字コードとエラーメッセージをコントロールする
PHPで文字コードとエラーメッセージをコントロールする
 
Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...
 
Pylons + Tokyo Cabinet
Pylons + Tokyo CabinetPylons + Tokyo Cabinet
Pylons + Tokyo Cabinet
 
Yakiniku(焼き肉) on the Cloud
Yakiniku(焼き肉) on the CloudYakiniku(焼き肉) on the Cloud
Yakiniku(焼き肉) on the Cloud
 
Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)
 
How To Create Custom DSLs By PHP
How To Create Custom DSLs By PHPHow To Create Custom DSLs By PHP
How To Create Custom DSLs By PHP
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)
 
yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
Becoming A Php Ninja
Becoming A Php NinjaBecoming A Php Ninja
Becoming A Php Ninja
 
2007 0822 Antelope Php
2007 0822 Antelope Php2007 0822 Antelope Php
2007 0822 Antelope Php
 
第1回PHP拡張勉強会
第1回PHP拡張勉強会第1回PHP拡張勉強会
第1回PHP拡張勉強会
 

Último

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Último (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Tokyo Tyrant + PHP

  • 1. Tokyo Tyrant + PHP 小山健一郎
  • 2. Agenda • About Me • About Tokyo Tyrant • Tokyo Tyrant + PHP • Simple Benchmark PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 2
  • 3. About Me PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 3
  • 4. About Me • name: –小山健一郎 (id:k1LoW) •from Fukuoka • type: –PHPer, CakePHP baker, Emacser • membership: –Fusic Co.,Ltd • >> http://fusic.co.jp –codecheck.in • >> http://trac.codecheck.in and 101000code / 3rdSTONE PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 4
  • 5. PHPといえば*AMP PHP = *AMP? PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 5
  • 6. PostgreSQL ちなみに私はLAPPが好きです I like LAPP PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 6
  • 7. RDBMもいいけれど key/value型DBMも使ってみたい! I like RBMS. But,I want to use key/value DBM too. PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 7
  • 8. About Tokyo Tyrant PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 8
  • 9. Tokyo Tyrant (TT) • Tokyo Tyrant is network interface of Tokyo Cabinet (key/value DB library) – http://tokyocabinet.sourceforge.net/tyrantdoc/ PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 9
  • 10. Tokyo Tyrant (TT) • Tokyo Cabinet (TC)というkey/value型DBMの ネットワークインターフェース – Author:平林幹雄氏 – http://tokyocabinet.sourceforge.net/tyrantdoc/ • mixiの「最終ログイン」などを管理(しているらしい) – ↑ユーザがアクセスするたびに更新されるという高負荷 • TCP/IP上からバイナリプロトコルで接続可能 – memcachedのプロトコルにも対応 – HTTP互換 PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 10
  • 11. PHPからTokyo Tyrantを使いたい! I want to use Tokyo Tyrant with PHP! PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 11
  • 12. Tokyo Tyrant + PHP PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 12
  • 13. Tokyo Tyrant + PHP TT+PHPを実現するInterfaceや PHP Extensionは見つけているも のだけで4つ –TT独自バイナリプロトコルを扱うもの のみ –memcached互換のものは今回は除く PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 13
  • 14. Net_TokyoTyrant PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 14
  • 15. Net_TokyoTyrant • Author –個々一番氏(id:cocoiti) • feature –PurePHPライブラリ –Openpearにてリポジトリ管理 • http://openpear.org/package/Net_TokyoTyrant –PurePHPとして最適化されている –おそらく最も有名(だと思う) PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 15
  • 16. インストール Install PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 16
  • 17. $sudo pear install openpear/Net_TokyoTyrant-beta PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 17
  • 18. 簡単 Easy PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 18
  • 19. php-tokyo_tyrant • Author –Mikko Koppanen氏 (mkoppanen) • feature –PHP Extension –PECLに登録されている • PHP Manualもある –GitHubにてリポジトリ管理 • http://github.com/mkoppanen/php-tokyo_tyrant/tree/ master –最も活発に開発が進んでいる PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 19
  • 20. インストール Install PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 20
  • 21. $sudo pecl install tokyo_tyrant-beta PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 21
  • 22. 簡単 Easy PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 22
  • 23. dbo_tokyo • Author –Martin Samson氏 (masom) • feature –Datasource for CakePHP thechawにてリポジトリ管理 • http://thechaw.com/tokyotyrant_datasource ※#cakephp@irc.codecheck.in:6667で id:cakephperさんに教えてもらいました PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 23
  • 24. tokyotyrant_php • Author –俺 • feature –tokyotyrant.rbに、できるだけ近づけ た実装を目指している –Net_TokyoTyrantを参考に作成 • Fork? –GitHubにてリポジトリ管理 • http://github.com/k1LoW/tokyotyrant_php/tree/master –最もβ、むしろα PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 24
  • 25. Simple Benchmark PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 25
  • 26. ※参考程度に考えてください It's very simple ^^; PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 26
  • 27. PHPなのでhttp://で アクセスしてみた Simple HTTP Access Benchmark PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 27
  • 28. Simple Benchmark • 単純にApache Benchで計測して みた ランダムなkeyで クエリ発行 ab –n 1000 – c 100 •Apache 対象データ: sha1($i)をkey、$iをvalueとした •mod_php 1,000,000レコード •DBM PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 28
  • 29. 1アクセス1クエリ ※Request/sec相対 1 access 1 query PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 29
  • 30. 1アクセス1クエリ Net_TokyoTyrant dbo_tokyo MySQL plane html php-tokyo_tyrant tokyotyrant_php ※Request/sec相対 PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 30
  • 31. 1アクセス100クエリ ※Request/sec相対 1 access 100 query PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 31
  • 32. 1アクセス100クエリ ! Net_TokyoTyrant dbo_tokyo MySQL plane html php-tokyo_tyrant tokyotyrant_php ※Request/sec相対 PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 32
  • 33. まとめ • Tokyo Tyrant + PHPの紹介をしま した。 • php-tokyo_tyrantが最も高速 – php-tokyo_tyrant = very fast • PurePHPならNet_TokyoTyrant – Net_TokyoTyrant = Nice PurePHP library • CakePHPならdbo_tokyo – dbo_tokyo = CakePHP use • tokyotyrant_phpは…? PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 33