|Project Name||Stars||Downloads||Repos Using This||Packages Using This||Most Recent Commit||Total Releases||Latest Release||Open Issues||License||Language|
|Php Pm||6,478||42||10||8 months ago||20||January 09, 2022||32||mit||PHP|
|PPM is a process manager, supercharger and load balancer for modern PHP applications.|
|Symfony Messenger Fix||4||9 days ago||mit||PHP|
|Workaround for symfony messenger that fixes issues with RabbitMQ on AWS losing connection when connection stays idle for longer time|
|Enhavo Proxy||3||2 years ago||24||mit||PHP|
|http(s) proxy for caching and loadbalancing with web interface based on varnish and nginx|
PHP-PM is a process manager, supercharger and load balancer for PHP applications.
It's based on ReactPHP and works best with applications that use request-response frameworks like Symfony's HTTPKernel. The approach of this is to kill the expensive bootstrap of PHP (declaring symbols, loading/parsing files) and the bootstrap of feature-rich frameworks. See Performance section for a quick hint. PHP-PM basically spawns several PHP instances as worker bootstraping your application (eg. the whole Symfony Kernel) and hold it in the memory to be prepared for every incoming request: This is why PHP-PM makes your application so fast.
More information can be found in the article: Bring High Performance Into Your PHP App (with ReactPHP)
Does your app/library support PPM? Show it!
cd into/your-application # run Symfony docker run -v "$(pwd):/var/www" -p 8080:80 phppm/nginx --bootstrap=symfony --static-directory=web/ # run Laravel docker run -v "$(pwd):/var/www" -p 8080:80 phppm/nginx --bootstrap=laravel --static-directory=public/
Docker is easier to setup and maintain. If your applications requires additional environment tools or libraries, you can build your own image based on ours. See github.com/php-pm/php-pm-docker for more information.
debug is enabled, PHP-PM detects file changes and restarts its worker automatically.
Follow the wiki article Use without Docker.
To get the maximum performance you should usually use
--app-env=prod with disabled
--debug=0. Also make sure xdebug is disabled. Try with different amount of workers.
Usually a 10% over your cpu core count is good. Example: If you have 8 real cores (excl. hyper-threading) use
To get even more performance (for static file serving or for rather fast applications) try a different event loop (see reactphp/event-loop).
If you get strange issues in your application and you have no idea where they are coming from try
using only one worker
--workers=1 and enable
When debugging you should use xdebug as you're used to. If you set a break point and hold the application, then only one worker is stopped until you release the break point. All other workers are fully functional.
Note for XDebug and PHPStorm: Since php-pm uses at least two processes, there are two xdebug instances as well. PHPStorm is per default configured to only accept one connection at a time. You need to increase that. You won't get xdebug working with your application if you don't increase that count.
In all workers the STDOUT is redirected to the connected client. So take care,
echo are not displayed on the console.
STDERR is not redirected to the client, but to the console. So, for very simple debugging you could use
error_log('hi') and you'll see it on the console.
Per default exceptions and errors are only displayed on the console, prettified with Symfony/Debug component.
HttpKernel for Symfony/Laravel - php-pm/php-pm-httpkernel
Zend - php-pm/php-pm-zend
CakePHP - CakeDC/cakephp-phppm
cd my-project docker run -v `pwd`:/var/www -p 8080:80 phppm/nginx --static-directory=web/
cd my-project docker run -v `pwd`:/var/www -p 8080:80 phppm/nginx --bootstrap=laravel --static-directory=web/
cd my-project docker run -v `pwd`:/var/www -p 8080:80 phppm/nginx --bootstrap=Zf2
For all Wordpress lovers out there: PPM is not going to work with Wordpress due to the lack of request-response abstraction. We highly doubt that Wordpress is ever going to be compatible because its architecture is written in a way that makes it currently impossible to serve multiple requests in one application process.
6x4GHz Intel i7, 16GB RAM. 10 concurrent, 1000 total request:
ab -c 10 -n 1000 http://127.0.0.1:8080/
ppm start --bootstrap=symfony --app-env=prod --logging=0 --debug=0 --workers=20
|PHP Version||Dynamic at Jarves||Static file|
ppm start --bootstrap=laravel --app-env=prod --debug=0 --logging=0 --workers=20
php70-event, but you can try LibEventLoop
Please help us fix these issues by creating pull requests. :)
We provide ready-to-use docker images you can use right away. If you have own setup, see in the PHP-PM docker repository how to integrate PHP-PM in your NGiNX setup.
To get the real remote IP in your Symfony application for example, don't forget to add ppm (default
as trusted reverse proxy.
# app/config/config.yml # ... framework: trusted_proxies: [127.0.0.1]
More information at http://symfony.com/doc/current/cookbook/request/load_balancer_reverse_proxy.html.