Albert Casademont

Supercharge your apps with ReactPHP & PHP-PM by Albert Casademont

Have you ever wondered how to enhance your app’s performance after fine-tunning the very last bit of your current PHP stack? Maybe it’s time to think of an alternative!

Let me convince you to ditch your PHP-FPM server and embrace the world of ReactPHP! Yes, you’ve heard of ReactPHP, but that’s “too experimental” for you. Guess, what: it’s not, thanks to PHP-PM, a ReactPHP process manager, you can give your app a nice performance boost with an alternative production-ready application server.

Prepare yourself to dive into the lifecycle of a PHP request (compilation, opcode generation, memory allocation, execution, IO...) and to understand why there’s not much more room for performance improvements using the current stacks. We will also discuss the pros and cons of the ReactPHP + PHP-PM approach using a Symfony 4 app as an example, including developer experience and deployment options with containers.

Talk Questions

  • Question 182
    Rasmus didn’t like async idea and he suggested to use queues and put hard works in other workers. What do you think about it?
  • Question 179
    If you want async, why not just use node? ReactPHP seems a very complicated way to achieve the same that node does
  • Question 190
    What is difference comparing this solutions to swoole?
  • Question 175
    How do you handle memory leaks ?
  • Question 180
    Why use ReactPHP over NodeJS for example?
  • Question 176
    I don't get the difference between this and a worker listening to a queue, can you explain it?
  • Question 172
    You said that you are performance junke, but you are still using symfony with most likely a lot of high level packages like doctrine which are slow?
  • Question 177
    How does React make inherently blocking things like SQL calls asynchronous?
  • Question 133
    Asynchronous PHP does not affect your health or skin, how do you do it? 😉
  • Question 173
    Would the new preloading feature in PHP 7.4 avoid all the overhead of loading classes and pair in terms of speed with a ReactPHP HTTP application?
  • Question 194
    When a database request fails, the Doctrine entity manager usually closes the connection. Since they are all sharing the same $db variable, how do you deal with that?
  • Question 183
    What is the main use case of React PHP?
  • Question 185
    Because php do not support async functionality due to obvious reasons, If you need coroutines or multi threads why just don’t pick suited languages like python, java, kotlin, nodejs etc...
  • Question 196
    How to control max execution time of a request in a ReactPhp worker?
  • Question 178
    Do you think we can expect some kind of native async I/O and native event loop support on php
  • Question 187
    Doesn't the overhead of callable functions for async lower the performance boost gained on boot?
  • Question 199
    How does reactPHP scale when there are many requests in comparison with having many fpm workers? Being fast is great but if you are only fast for 5 people its not worth much.
  • Question 174
    What about CPU multi core and making use of this to gain performance?
  • Question 181
    Do I always need to create a server? Is this possible to use ReactPHP only for some specific cases? As usually I need async process in really rare cases, but async power would be great addition
  • Question 184
    How will ReactPHP work with PHP8?
  • Question 186
    Any performance comparissons between ReactPHP and Amp?
  • Question 188
    Show us metrics with blackfire please
  • Question 189
    What is better, ReactPhp or nodejs ? Performance?
  • Question 191
    Who wants to increase speed of theirs applications should also look at the Road Runner. It doesn't have the ReactPHP cons and have a lot of pros.
  • Question 193
    What about of save the all bootstrap objects on db or redis like do Drupal 8 ?
  • Question 200
    How well can ppm deal with many connections?
  • Question 171
    Instead of nginx/apache + php-fpm why not use the road runner server?
  • Question 192
    ReactPHP provides a few adapters for your I/O, what about programming new adapters for your I/O?
  • Question 197
    Would adding replicas for the React PHP worker do the same function as PHP-PM?
  • Question 198
    What about framework coupling using promises?
  • Question 201
    PPM written in C. Could it be considerably faster?
  • Question 202
    Do you need 1 worker by use case? Eg. By controller
  • Question 203
    Does react support multiple processes / -threading with pnctl?
  • Question 205
    Because async in go is like using a inoxsteel knife to cut meat, and php a wooden knife. Be polyglote :D
  • Question 206
    When the worker is restarded, it waits to finish the current request?