Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Swooleのフレームワークをくらべてみた

 Swooleのフレームワークをくらべてみた

PHPerKaig2019の発表資料です

uzullaさんのPHPerKaigi2018「大統一PHP」
https://speakerdeck.com/uzulla/da-tong-php
で紹介されているSwooleという非同期かつ、Coroutineの仕組みをもったPHPのextensionがあります。
Swooleを用いたフレームワークはいくつかあります。
今回、EasySwoole(v2,v3)、Swoft、Laravel-Swooleの3つの比べてみた結果をお話しします。
それぞれのフレームワークのISUCON8予選のベンチマークの結果をお伝えします(恒例)
No.1 Swooleフレームワークはどれだ!

CyberAgent SGE Engineer

March 31, 2019
Tweet

More Decks by CyberAgent SGE Engineer

Other Decks in Technology

Transcript

  1. 4XPPMFͷϑϨʔϜϫʔΫΛ
    ͘Β΂ͯΈͨ
    !HPPEPP

    QIQFSLBJHJ

    View full-size slide

  2. • גࣜձࣾαΠόʔΤʔδΣϯτ
    • 4(&౷ׅຊ෦ٕज़౷ׅࣨࣨ௕
    • ࢠձࣾࣾ$50
    • גࣜձࣾ$SBGU&HH
    • גࣜձࣾδʔΫϨετ
    • גࣜձࣾαϜβοϓ
    • നҪɹӳ
    • ΤϯδχΞ
    • #MPH
    IUUQBNFCMPKQHPPEPP
    ͓લɺ୭Α
    • 5XJUUFS
    !HPPEPP
    • %2
    ͙ͪ͢Ή '#

    ϓΫϦϙ ཱྀܳਓ

    View full-size slide

  3. "HFOEB
    w4XPPMFͱ͸
    w4XPPMFΛ༻͍ͨϑϨʔϜϫʔΫ
    wࠓճ͓࿩͢ΔϑϨʔϜϫʔΫ
    wDPSPVUJOFͷॻ͖ํ
    wϕϯνϚʔΫ݁Ռ
    w·ͱΊ

    View full-size slide

  4. 1)1ͰΠϕϯτۦಈͷඇಉظ
    ˍίϧʔνϯϕʔεͷฒߦॲཧ

    View full-size slide

  5. 1)1FS,JBHJͷV[VMMB͞ΜͷൃදͰ஌Γ·ͨ͠
    https://speakerdeck.com/uzulla/da-tong-php

    View full-size slide

  6. 1)1ͷFYUFOTJPOͱͯ͠
    ಋೖ͠·͢
    # pecl install swoole

    View full-size slide

  7. 4XPPMFΛ༻͍ͨ
    ϑϨʔϜϫʔΫ

    View full-size slide

  8. 4XPPMFͷ(JU)VCͰ঺հ͞Ε͍ͯΔ
    ϑϨʔϜϫʔΫɹ̏ͭ
    https://github.com/swoole/swoole-src

    View full-size slide

  9. 4XPGU
    ϞμϯͰɺߴੑೳͰ
    "01ͱ$PSPVUJOFΛ
    උ͑ͨϑϨʔϜϫʔΫ
    1)1$PO4FOEBJͷ-5Ͱ
    ࿩͠·ͨ͠
    https://speakerdeck.com/sgeengineer/swoolewotukatutahuremuwakuswoftwotafalsesimu
    ϞμϯͳϑϨʔϜϫʔΫͳΒɺͪ͜Β

    View full-size slide

  10. &BTZTXPPMF
    ؆୯ʹ4XPPMFΛࢼ͢ͷͳΒɺͪ͜Β
    https://speakerdeck.com/sgeengineer/isucon8deyu-xuan-luo-tisitafalsede-swoole-easyswoole-deshu-kihuan-ete-gan-xiang-zhan-debentizou-rasetemitahua
    1)1$POGFSFODFͷ
    -5Ͱ࿩͠·ͨ͠ɾɾɾ

    View full-size slide

  11. 4BCFS
    'BUF޷͖͕ͭͬͨͬ͘Ά͍

    View full-size slide

  12. 4XPPMFͷ(JU)VCͰ঺հ͞Ε͸͞Ε͍ͯͳ͍
    Ͱ͕͢ɺݸਓతʹ஫໨͍ͯ͠ΔϑϨʔϜϫʔΫ

    View full-size slide

  13. ࠓճ͓࿩͢Δ
    ϑϨʔϜϫʔΫ

    View full-size slide

  14. w&BTZ4XPPMF W W

    w4XPGU
    w-BSBWFM4XPPMF

    View full-size slide


  15. &BTZ4XPPMF

    &BTZ4XPPMF
    https://github.com/easy-swoole/easyswoole

    View full-size slide

  16. ಛ௃

    &BTZ4XPPMF
    •Built-in HTTP, TCP,
    WebSocket,Udp
    Coroutine Server
    •Global dependency
    injection container
    •PSR-7 based HTTP
    message
    implementation
    •RESTful supported
    •HTTP,TCP, WebSocket,
    Udp middleware support
    •Mysql, Redis, RPC,
    HTTP Coroutine Clients
    •High performance
    router
    •Universal connection
    pools
    •Remote Console
    W

    View full-size slide

  17. W͔Βͷվળ఺
    ࣗ෼͕ؾ͍ͮͨ఺


    &BTZ4XPPMF

    View full-size slide

  18. %#ͷτϥϯβΫγϣϯ
    ·ΘΓ͕੔උ͞Εͨ
    W͸ͳ͔ͬͨɾɾ


    &BTZ4XPPMF

    View full-size slide

  19. $POpH͕EFWͱ
    QSPEVDUJPOͱΛ෼͚ͯ
    ؅ཧͰ͖ΔΑ͏ʹͳͬͨ
    W͸ͳ͔ͬͨɾɾɾ


    &BTZ4XPPMF

    View full-size slide


  20. &BTZ4XPPMF
    ىಈ࣌ʹ؀ڥ໊Λࢦఆ
    ແࢦఆͩͱEFWͷDPOpH͕ద༻͞ΕΔʣ
    $ php easyswoole start produce

    View full-size slide

  21. &BTZ4XPPMFͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ App        
    │ ├ HttpController
    │ │ ├ BooksController.php
    │ │ └ Router.php
    │ ├ Model
    │ │ └ BookModel.php
    │ └ Utility
    │   └ Pool
    │     ├ MysqlObject.php
    │     └ MysqlPool.php
    ├ Views
    │ └ index.twig
    ├ Log
    ├ Temp
    ├ vendor
    ├ Static
    │ ├ css
    │ └ js
    ├ easyswoole
    ├ production.php
    └ dev.php

    &BTZ4XPPMF

    View full-size slide

  22. &BTZ4XPPMFͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ App        
    │ ├ HttpController
    │ │ ├ BooksController.php
    │ │ └ Router.php
    │ ├ Model
    │ │ └ BookModel.php
    │ └ Utility
    │   └ Pool
    │     ├ MysqlObject.php
    │     └ MysqlPool.php
    ├ Views
    │ └ index.twig
    ├ Log
    ├ Temp
    ├ vendor
    ├ Static
    │ ├ css
    │ └ js
    ├ easyswoole
    ├ production.php
    └ dev.php

    &BTZ4XPPMF
    ίϯτϩʔϥʔ

    View full-size slide

  23. &BTZ4XPPMFͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ App        
    │ ├ HttpController
    │ │ ├ BooksController.php
    │ │ └ Router.php
    │ ├ Model
    │ │ └ BookModel.php
    │ └ Utility
    │   └ Pool
    │     ├ MysqlObject.php
    │     └ MysqlPool.php
    ├ Views
    │ └ index.twig
    ├ Log
    ├ Temp
    ├ vendor
    ├ Static
    │ ├ css
    │ └ js
    ├ easyswoole
    ├ production.php
    └ dev.php

    &BTZ4XPPMF
    ϧʔλʔ

    View full-size slide

  24. &BTZ4XPPMFͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ App        
    │ ├ HttpController
    │ │ ├ BooksController.php
    │ │ └ Router.php
    │ ├ Model
    │ │ └ BookModel.php
    │ └ Utility
    │   └ Pool
    │     ├ MysqlObject.php
    │     └ MysqlPool.php
    ├ Views
    │ └ index.twig
    ├ Log
    ├ Temp
    ├ vendor
    ├ Static
    │ ├ css
    │ └ js
    ├ easyswoole
    ├ production.php
    └ dev.php

    &BTZ4XPPMF
    Ϟσϧ

    View full-size slide

  25. &BTZ4XPPMFͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ App        
    │ ├ HttpController
    │ │ ├ BooksController.php
    │ │ └ Router.php
    │ ├ Model
    │ │ └ BookModel.php
    │ └ Utility
    │   └ Pool
    │     ├ MysqlObject.php
    │     └ MysqlPool.php
    ├ Views
    │ └ index.twig
    ├ Log
    ├ Temp
    ├ vendor
    ├ Static
    │ ├ css
    │ └ js
    ├ easyswoole
    ├ production.php
    └ dev.php

    &BTZ4XPPMF
    %#ͷίωΫγϣ
    ϯϓʔϧ

    View full-size slide

  26. &BTZ4XPPMFͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ App        
    │ ├ HttpController
    │ │ ├ BooksController.php
    │ │ └ Router.php
    │ ├ Model
    │ │ └ BookModel.php
    │ └ Utility
    │   └ Pool
    │     ├ MysqlObject.php
    │     └ MysqlPool.php
    ├ Views
    │ └ index.twig
    ├ Log
    ├ Temp
    ├ vendor
    ├ Static
    │ ├ css
    │ └ js
    ├ easyswoole
    ├ production.php
    └ dev.php

    &BTZ4XPPMF
    ςϯϓϨʔτϑΝΠϧ

    View full-size slide

  27. &BTZ4XPPMFͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ App        
    │ ├ HttpController
    │ │ ├ BooksController.php
    │ │ └ Router.php
    │ ├ Model
    │ │ └ BookModel.php
    │ └ Utility
    │   └ Pool
    │     ├ MysqlObject.php
    │     └ MysqlPool.php
    ├ Views
    │ └ index.twig
    ├ Log
    ├ Temp
    ├ vendor
    ├ Static
    │ ├ css
    │ └ js
    ├ easyswoole
    ├ production.php
    └ dev.php

    &BTZ4XPPMF
    ੩తϑΝΠϧ

    View full-size slide

  28. &BTZ4XPPMFͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ App        
    │ ├ HttpController
    │ │ ├ BooksController.php
    │ │ └ Router.php
    │ ├ Model
    │ │ └ BookModel.php
    │ └ Utility
    │   └ Pool
    │     ├ MysqlObject.php
    │     └ MysqlPool.php
    ├ Views
    │ └ index.twig
    ├ Log
    ├ Temp
    ├ vendor
    ├ Static
    │ ├ css
    │ └ js
    ├ easyswoole
    ├ production.php
    └ dev.php

    &BTZ4XPPMF
    ىಈ༻ϑΝΠϧ

    View full-size slide

  29. &BTZ4XPPMFͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ App        
    │ ├ HttpController
    │ │ ├ BooksController.php
    │ │ └ Router.php
    │ ├ Model
    │ │ └ BookModel.php
    │ └ Utility
    │   └ Pool
    │     ├ MysqlObject.php
    │     └ MysqlPool.php
    ├ Views
    │ └ index.twig
    ├ Log
    ├ Temp
    ├ vendor
    ├ Static
    │ ├ css
    │ └ js
    ├ easyswoole
    ├ production.php
    └ dev.php

    &BTZ4XPPMF
    $POpHϑΝΠϧ
    ؀ڥ͝ͱ

    View full-size slide

  30. ίωΫγϣϯϓʔϧ

    &BTZ4XPPMF

    View full-size slide

  31. ίωΫγϣϯϓʔϧ

    &BTZ4XPPMF
    ίϯτϩʔϥʔͰɺϦΫΤετ։࢝͝ͱ
    ʹݺͼग़͞ΕΔϝιου

    View full-size slide

  32. ίωΫγϣϯϓʔϧ

    &BTZ4XPPMF
    ϓʔϧ͔Β%#ͷΠϯελϯεΛऔΓग़͢

    View full-size slide

  33. ίωΫγϣϯϓʔϧ

    &BTZ4XPPMF
    ίϯτϩʔϥʔͰɺϦΫΤετऴྃ͝ͱ
    ʹݺͼग़͞ΕΔϝιου

    View full-size slide

  34. ίωΫγϣϯϓʔϧ

    &BTZ4XPPMF
    ϦιʔεΛϓʔϧʹฦ٫

    View full-size slide

  35. ϧʔλʔ

    &BTZ4XPPMF

    View full-size slide

  36. ϧʔλʔ

    &BTZ4XPPMF
    ؆୯ͳॲཧͳΒͦͷ··͔͚Δ

    View full-size slide

  37. ϧʔλʔ

    &BTZ4XPPMF
    (&5ɺ1045ɺ165ɺ%&-&5&Λࢦఆ
    ͯ͠ɺϧʔςΟϯά

    View full-size slide

  38. ίϯϑΟά

    &BTZ4XPPMF

    View full-size slide

  39. ίϯϑΟά

    &BTZ4XPPMF
    4XPPMFपΓͷઃఆ͸͜͜

    View full-size slide

  40. ίϯϑΟά

    &BTZ4XPPMF
    .Z42-ͷઃఆ͸ίί

    View full-size slide

  41. ΘΓͱૉ௚ʹѻ͑Δ
    ϑϨʔϜϫʔΫ

    &BTZ4XPPMF

    View full-size slide


  42. 4XPGU

    4XPGU
    https://www.swoft.org/

    View full-size slide

  43. •Base on Swoole extension
    •Built-in HTTP, TCP, WebSocket
    Coroutine Server
    •Powerful AOP (Aspect Oriented
    Programming)
    •Flexible and comprehensive
    annotations framework
    •Global dependency injection
    container
    •PSR-7 based HTTP message
    implementation
    •PSR-14 based event manager
    •PSR-15 based middleware
    •PSR-16 based cache design
    •Scalable high performance RPC
    •Holistic service governance, fallback,
    load balance, service registration
    and discovery
    •Database ORM
    •Universal connection pools
    •Mysql, Redis, RPC, HTTP Coroutine
    Clients
    •Coroutine driver client and blocking
    driver client seamlessly switch
    automatically
    •Coroutine and asynchronous task
    delivery
    •Custom user processes
    •RESTful supported
    •Internationalization (i18n) supported
    •High performance router
    •Fast and flexible parameter validator
    •Alias mechanism
    •Powerful log component
    •Cross-platform application auto-
    reload mechanism
    https://github.com/swoft-cloud/swoft ͷREADMEͷӳ༁
    Ҿ༻ɿ

    4XPGU

    View full-size slide

  44. •Built-in HTTP, TCP,
    WebSocket Coroutine
    Server
    •Powerful AOP
    (Aspect Oriented
    Programming)
    •Database ORM
    •Universal connection
    pools
    •Flexible and
    comprehensive
    annotations
    framework
    •Global dependency
    injection container
    •PSR-7 based HTTP
    message
    implementation
    ಛ௃

    4XPGU

    View full-size slide

  45. 3FRVFTUMJGFDZDMF
    https://doc.swoft.org/master/zh-CN/core/framework.html

    4XPGU

    View full-size slide

  46. 4XPGUͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ app        
    │ ├ Controllers
    │ │ └ BooksController.php
    │ └ Models
    │   └ Entity
    │    └ Books.php
    ├ config
    │ ├ beans
    │ │ └ base.php
    │ └ properties
    │   ├ app.php
    │   └ db.php
    ├ public
    ├ runtime
    │ ├ logs
    │ ├ uploadfiles
    │ └ sessions
    ├ resources
    │ └ views
    │   └ books
    │     └ view.php
    └ bin
      ├ bootstrap.php
      └ swoft

    4XPGU

    View full-size slide

  47. 4XPGUͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ app        
    │ ├ Controllers
    │ │ └ BooksController.php
    │ └ Models
    │   └ Entity
    │    └ Books.php
    ├ config
    │ ├ beans
    │ │ └ base.php
    │ └ properties
    │   ├ app.php
    │   └ db.php
    ├ public
    ├ runtime
    │ ├ logs
    │ ├ uploadfiles
    │ └ sessions
    ├ resources
    │ └ views
    │   └ books
    │     └ view.php
    └ bin
      ├ bootstrap.php
      └ swoft
    ίϯτϩʔϥʔ
    Ϟσϧ

    4XPGU

    View full-size slide

  48. 4XPGUͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ app        
    │ ├ Controllers
    │ │ └ BooksController.php
    │ └ Models
    │   └ Entity
    │    └ Books.php
    ├ config
    │ ├ beans
    │ │ └ base.php
    │ └ properties
    │   ├ app.php
    │   └ db.php
    ├ public
    ├ runtime
    │ ├ logs
    │ ├ uploadfiles
    │ └ sessions
    ├ resources
    │ └ views
    │   └ books
    │     └ view.php
    └ bin
      ├ bootstrap.php
      └ swoft
    ౎౓ಡΈࠐ·ΕΔ
    ઃఆϑΝΠϧ
    ˞FOW͕༏ઌ
    CFBOੜ੒࣌ʹಡΈࠐ·ΕΔ
    ϑΝΠϧ

    4XPGU

    View full-size slide

  49. 4XPGUͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ app        
    │ ├ Controllers
    │ │ └ BooksController.php
    │ └ Models
    │   └ Entity
    │    └ Books.php
    ├ config
    │ ├ beans
    │ │ └ base.php
    │ └ properties
    │   ├ app.php
    │   └ db.php
    ├ public
    ├ runtime
    │ ├ logs
    │ ├ uploadfiles
    │ └ sessions
    ├ resources
    │ └ views
    │   └ books
    │     └ view.php
    └ bin
      ├ bootstrap.php
      └ swoft
    ੩తϑΝΠϧஔ͖৔
    DTTɺKT


    4XPGU

    View full-size slide

  50. 4XPGUͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ app        
    │ ├ Controllers
    │ │ └ BooksController.php
    │ └ Models
    │   └ Entity
    │    └ Books.php
    ├ config
    │ ├ beans
    │ │ └ base.php
    │ └ properties
    │   ├ app.php
    │   └ db.php
    ├ public
    ├ runtime
    │ ├ logs
    │ ├ uploadfiles
    │ └ sessions
    ├ resources
    │ └ views
    │   └ books
    │     └ view.php
    └ bin
      ├ bootstrap.php
      └ swoft
    Ұ࣌ϑΝΠϧஔ͖৔

    4XPGU

    View full-size slide

  51. 4XPGUͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ app        
    │ ├ Controllers
    │ │ └ BooksController.php
    │ └ Models
    │   └ Entity
    │    └ Books.php
    ├ config
    │ ├ beans
    │ │ └ base.php
    │ └ properties
    │   ├ app.php
    │   └ db.php
    ├ public
    ├ runtime
    │ ├ logs
    │ ├ uploadfiles
    │ └ sessions
    ├ resources
    │ └ views
    │   └ books
    │     └ view.php
    └ bin
      ├ bootstrap.php
      └ swoft
    UFNQMBUFϑΝΠϧ

    4XPGU

    View full-size slide

  52. 4XPGUͷϑΥϧμߏ੒ ࠷খݶ

    Project
    ├ app        
    │ ├ Controllers
    │ │ └ BooksController.php
    │ └ Models
    │   └ Entity
    │    └ Books.php
    ├ config
    │ ├ beans
    │ │ └ base.php
    │ └ properties
    │   ├ app.php
    │   └ db.php
    ├ public
    ├ runtime
    │ ├ logs
    │ ├ uploadfiles
    │ └ sessions
    ├ resources
    │ └ views
    │   └ books
    │     └ view.php
    └ bin
      ├ bootstrap.php
      └ swoft
    ىಈ༻ϑΝΠϧ

    4XPGU

    View full-size slide

  53. ίϯτϩʔϥʔ

    4XPGU

    View full-size slide

  54. ίϯτϩʔϥʔ
    w 63-ͷϚοϐϯάΛBOOPUBUJPOͰ
    ઃఆ
    w ςϯϓϨʔτɺϨΠΞ΢τϑΝΠϧΛ
    BOOPUBUJPOͰઃఆ

    4XPGU

    View full-size slide

  55. ίϯτϩʔϥʔ
    143४ڌ

    4XPGU

    View full-size slide

  56. ίϯτϩʔϥʔ
    ʙதུʙ
    %FQFOEFODZ
    *OKFDUJPO

    4XPGU

    View full-size slide

  57. Ϟσϧ &OUJUZ


    4XPGU

    View full-size slide

  58. Ϟσϧ &OUJUZ

    $ php bin/swoft entity:create -d bookshelf
    ࣍ͷίϚϯυͰ%#͔Βࣗಈੜ੒
    ϦόʔεΤϯδχΞϦϯά


    4XPGU

    View full-size slide

  59. Ϟσϧ03.

    4XPGU

    View full-size slide

  60. Ϟσϧ03.
    03.
    #PPLTςʔϒϧσʔλΛऔಘ


    4XPGU

    View full-size slide

  61. $POpH%#

    4XPGU

    View full-size slide

  62. $POpH%#
    DPOOFDUJPOQPPMͷઃఆ

    4XPGU

    View full-size slide

  63. Ұ௨Γἧ͍ͬͯΔ
    ϑϧελοΫ
    ϑϨʔϜϫʔΫ

    4XPGU

    View full-size slide


  64. -BSBWFM4XPPMF

    -BSBWFM4XPPMF
    https://github.com/swooletw/laravel-swoole

    View full-size slide

  65. ಛ௃
    -BSBWFMͷ
    ΞϓϦέʔγϣϯ͕
    4XPPMFͰಈ͘

    -BSBWFM4XPPMF

    View full-size slide

  66. -BSBWFMͰΞϓϦέʔγϣ
    ϯΛͭ͘Δ

    -BSBWFM4XPPMF
    ඇಉظฒྻॲཧ͕΄͘͠ͳΔ
    -BSBWFM4XPPMFͰղܾ

    View full-size slide

  67. -BSBWFM
    UP
    -BSBWFM4XPPMF

    -BSBWFM4XPPMF

    View full-size slide


  68. DPNQPTFSʹ௥Ճ

    -BSBWFM4XPPMF

    DPOpHͷ1SPWJEFS௥Ճ

    View full-size slide


  69. 4XPPMF༻ͷDPOpHੜ੒

    -BSBWFM4XPPMF
    $ php artisan vendor:publish --tag=laravel-swoole

    DPOpHTXPPMF@IUUQQIQΛઃఆ

    View full-size slide


  70. ىಈ

    -BSBWFM4XPPMF
    $ php artisan swoole:http start
    ॳظઃఆͩͱ൪ϙʔτͰ଴ͪड͚·͢

    OHJOYͷઃఆ
    proxy_pass http://127.0.0.1:1215
    QSPYZ@QBTTͰઃఆ͠·͢
    https://github.com/swooletw/laravel-swoole/wiki

    View full-size slide

  71. -BSBWFMͰॻ͍ͨ
    ΞϓϦέʔγϣϯ͕
    ΄Μͱ͏ʹͦͷ··
    4XPPMFͰಈ͘ʂ

    -BSBWFM4XPPMF

    View full-size slide

  72. DPSPVUJOFͷॻ͖ํ

    View full-size slide

  73. ͲͷϑϨʔϜϫʔΫ΋
    4XPPMFͷؔ਺͕ݺ΂Δ
    ͷͰ࣍ͷΑ͏ʹ͔͚Δ

    View full-size slide

  74. HPؔ਺ͰDPSPVUJOFͱͯ͠ಈ࡞

    View full-size slide

  75. $IBOOFMΛ࡞੒
    $IBOOFMʹ
    σʔλΛ֨ೲ
    औΓग़͢
    ˞औΓग़ͨ͠σʔλ
    ͷॱং͸ෆఆ

    View full-size slide

  76. ϕϯνϚʔΫ
    ݁Ռ

    View full-size slide

  77. *46$0/
    ϕϯνϚʔΫ݁Ռ
    ൺֱ

    View full-size slide

  78. *46$0/ͷ͓୊
    8FCαΠτͷ࢓༷

    View full-size slide

  79. νέοτ༧໿αΠτ

    View full-size slide

  80. ϩάΠϯ͕͋Γɺηογϣϯ؅ཧඞཁ

    View full-size slide

  81. ੮༧໿ͷτϥϯβΫγϣϯ੍ޚ͋Γ

    View full-size slide

  82. ؅ཧը໘Ͱ$47μ΢ϯϩʔυ΋͋Δ

    View full-size slide

  83. ຊ൪ͱಉ͡؀ڥ͸
    ༻ҙͰ͖ͳ͔ͬͨͷͰ
    ($1্Ͱଌͬͨ
    ݁ՌͰ͢
    n1-highcpu-2ʢvCPU x 2ɺϝϞϦ 1.8 GBʣ

    View full-size slide

  84. ߏ੒ 4MJNɺ-BSBWFM

    ߏ੒ &BTZ4XPPMF 4XPGU -BSBWFM4XPPMF

    h2o php-fpm MySQL
    h2o Swoole MySQL


    View full-size slide

  85. %FGBVMU
    4MJN

    &BTZ4XPPMF
    W

    &BTZ4XPPMF
    W

    4XPGU -BSBWFM
    -BSBWFM
    4XPPMF
    ճ໨
    ̎ճ໨
    ճ໨
    ճ໨
    ̑ճ໨
    ฏۉ
    ˞ϩδοΫมߋͳ͠ͷঢ়ଶ
    1)1
    4XPPMF

    View full-size slide

  86. %FGBVMU
    4MJN

    &BTZ4XPPMF
    W

    &BTZ4XPPMF
    W

    4XPGU -BSBWFM
    -BSBWFM
    4XPPMF
    ճ໨
    ̎ճ໨
    ճ໨
    ճ໨
    ̑ճ໨
    ฏۉ
    ˞ϩδοΫมߋͳ͠ͷঢ়ଶ
    1)1
    4XPPMF
    ϑϨʔϜϫʔΫͷ
    ҧ͍͸ޡࠩͰ͢ʂ
    &BTZ4XPPMF W
    ͷ࣮૷ɿ
    4XPGUͷ࣮૷ɿ https://github.com/shirai-suguru/isucon8-swoft
    https://github.com/shirai-suguru/isucon8-easyswoole
    &BTZ4XPPMF W
    ͷ࣮૷ɿ https://github.com/shirai-suguru/isucon8-easyswoole-v3
    -BSBWFMͷ࣮૷ɿ https://github.com/shirai-suguru/isucon8-laravel
    -BSBWFM4XPPMFͷ࣮૷ɿ https://github.com/shirai-suguru/isucon8-laravel-swoole

    View full-size slide

  87. &BTZ4XPPMF͸एׯ҆ఆ౓
    ʹ͚ܽΔ͔΋
    ࣗ෼͕ॻ͍ͨ෦෼ͰϝϞϦ͕ϦʔΫͯ͠ΔՄ
    ೳੑ΋͋Δ͕

    ߴෛՙ࣌Τϥʔ͕ͰΔͱ͖͕͋ͬͨ
    ϕϯνϚʔΫॴײ

    View full-size slide

  88. ͓͢͢Ί͸ʁ

    View full-size slide

  89. ݸਓతʹ4XPGU
    ͋͘·Ͱݸਓͷײ૝Ͱ͢

    View full-size slide

  90. ͨͩ͠ɺ4XPGU͸
    ߋ৽ස౓͕Լ͕ͬͯ
    WΛ࡞͍ͬͯΔؾ഑

    View full-size slide

  91. কདྷੑ͸
    -BSBWFM4XPPMF
    ͋͘·Ͱݸਓͷײ૝Ͱ͢

    View full-size slide

  92. ಋೖͷෑډ͕௿͍
    ˍ
    ਓؾͷϑϨʔϜϫʔΫ
    ͕΄΅ͦͷ··ಈ͘

    View full-size slide

  93. Έͳ͞Μ΋
    4XPPMFΛ͔ͭͬͨ
    ϑϨʔϜϫʔΫʹ
    νϟϨϯδ͠·͠ΐ͏

    View full-size slide

  94. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠

    View full-size slide