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

React PHP & Symfony @ SymfonyCat 2016

React PHP & Symfony @ SymfonyCat 2016

My Reactd PHP & Symfony talk at Symfony Catalunya 2016. Please rate the talk at https://legacy.joind.in/talk/view/18618 thanks! :D

Albert Casademont

July 22, 2016
Tweet

More Decks by Albert Casademont

Other Decks in Programming

Transcript

  1. the life of a PHP request 1. parsing 2. AST

    (Abstract Syntax Tree) 3. bytecode 4. execution
  2. the life of a PHP request 1. parsing 2. AST

    (Abstract Syntax Tree) 3. bytecode 4.execution
  3. the life of a PHP request 1. parsing 2. AST

    (Abstract Syntax Tree) 3. bytecode 4.execution
  4. the life of a PHP request 1. parsing 2. AST

    (Abstract Syntax Tree) 3. bytecode 4.execution
  5. React PHP •reactor pattern, event loop •NodeJS style! •CLI PHP

    process •acts as an http server •===> globals persist! <====
  6. PHP-PM •acts as a process manager on top of React-php

    •also written in plain PHP •Much like PHP-FPM, but no fcgi
  7. test environment •1 VB, single core, 1GB RAM •ulabox.com website

    •Full Symfony 2.8.8, prod env •PHP-FPM: opcache, 5 workers •PHP-PM: no-opcache, 5 workers
  8. 0 10 20 30 40 median request time (ms) React

    FPM 0 20 40 60 80 100 requests per second React FPM
  9. important caveats •globals globals globals! •debugging becomes weird •Careful with

    Doctrine! •memory leaks •not production ready, still buggy
  10. the future •still work to do! •a whole new async

    world! •future default PHP app server? •it’s written in PHP => explore!!