5

As you can see there is a huge performance boost with newly php-pm package that is a good replace for regular php-fpm

does magento2 supports PHP-pm or what might happens if we use it on production

https://github.com/php-pm/php-pm

1
  • i dont think you need to look for alternatives, better to optimize your code.
    – MagenX
    Commented Sep 19, 2017 at 20:42

2 Answers 2

4

This is an very interesting project you found there, I saw several of this kind over the last I think 8 years. The performance gains are indeed quite good.

In general Magento2 should support PPM (thats how they name it in their readme, better we keep it, else people confuse it with PHP-FPM)

But, you may need to do some small modifications and add triggers to reset the state of Magento2. This was very easy in M1, they had a special function already build in for this. The problem starts, when some parts of the application use global or static variables, or they use built-in singletons. I mention this, because if you use magento, you usually also use a lot of 3th party modules, and they do not always follow best practices.

conclusion: its definitely possible, but may require some minor tweaking.

But before you start, you should understand a bit about why PPM(and also the other alternate application servers) is faster then usual setups. It removes the Bootstrap overhead, the one from php itself, and also the one of the application. (depends how good the application is prepared for this) This is mostly from PHP5 times. But they improved even the startup of php itself a lot. Let me add a screenshot of the time consumed in M1 for this part. enter image description here This was for a Full-page-cache module which was working inside of magento, so it covers not only the init time of php, but also the basic init of Magento1. This was 2 years ago, I heard php reduced its own init part again by 50% in 7.1 (which is already nearly nothing compared to the rest of the application)

More improvements are at least possible, if you dont need to init the framework on each request. But this argument is also quite easy to confute. See how much time the most basic request in magento takes. The contact Form or a simple cms page are good enough. Subtract ~0.020s and you got the maximum you can gain per request. Now compare how many % this is of your average request time. I guess its less then 50%, so you would not even double the performance of your application.

Also note, they mention "Zend is very experimental and not fully working", and Magento is using Zend a lot.

The basic Idea of an application server is, to have all the advantages of caching, without the need of serialization and fetching it from somewhere. But PHP is becoming so fast, that even hydrating objects from json is nearly free.

2
  • Nice answer ,... i will try and maybe post a blog about my experiment on magento2 with PPM Commented Sep 20, 2017 at 12:23
  • The example you provided is for the default Magento installation, and I think performance is not a problem when you have only a few hundred products. Magento bootstrap becomes a problem when you have too many extensions. Magento creates a giant XML and stores that in the cache, and each php-fpm process has to communicate with Redis during bootstrap to pull the cache and then maybe some config from MYSQL. PHP-PM is best when you have a huge catalog because it bypasses IPC and processing the giant XML Commented Jan 12, 2018 at 7:59
-5

PHP-FPM is fully supported.

It is the recommended way to get Magento working with nginx as you can read in the official documentation here : http://devdocs.magento.com/guides/v2.1/install-gde/prereq/nginx.html

1
  • i said PHP PM .. not FPM ! ... fpm was already supported ! Commented Sep 19, 2017 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.