lapinskas / roadrunner-ubiquity
RoadRunner and Ubiquity integration
Installs: 3 131
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 3
Forks: 3
Open Issues: 2
Requires
- php: >=7.4
- spiral/roadrunner: >=2.0
README
Makes the fastest PHP framework even faster.
Installation
Automatic installation
Just tell Ubiquity to run with RoadRunner
$ Ubiquity serve -t=roadrunner
All required components (except of PHP-CGI) will be installed at the first launch.
Manual installation
If you need package for your own projects, just require it via composer
$ composer require lapinskas/roadrunner-ubiquity
Dependencies
Ubiquity
Get Ubiquiry Framework if you have not done it yet
PHP-CGI
php-cgi 7.4 is required for this package.
Please note it's php-cgi, not php, so most probably you have not it installed by default.
php-cgi installation on Ubuntu 18.04 LTS
As of today, PHP 7.4 is not available in Ubuntu default repositories. In order to install it, you will have to get it from third-party repositories.
$ sudo add-apt-repository ppa:ondrej/php
Then update and upgrade to PHP 7.4
$ sudo apt update
and install php-cgi
$ sudo apt-get install php7.4-cgi
Usage
As an example of a basic usage, let's create default Ubiquity project and run it using RoadRunner
Create sample Ubiquity project
Let's create new project called 'firstProject' in a folder of your choice. Flag -a adds rather powerful UbiquityMyadmin application that we can use for usage testing.
$ Ubiquity new firstProject -a
$ cd firstProject
Note: if Ubiquity is not in your path, you can find it at ~/.composer/vendor/phpmv/ubiquity-devtools/src/Ubiquity
Run Ubiquity
Tell Ubiquity to run using RoadRunner
$ Ubiquity serve -t=roadrunner
Alternative - Run RoadRunner directly
Run RoadRunner in debug mode
$ ./rr serve -v -d
Open UbiquityMyadmin page
Open admin page of Ubiquity application in your browser http://127.0.0.1:8090/Admin
Ubiquity application is exactly the same and could be run using command "Ubiquity serve", NGINX or Apache servers. The only change is the entry point of the application.
Benchmarking
Each worker takes some time for the bootstraping / initialization for the very first request. The consecutive requests do not require the bootstraping that results in much faster processing after all workers have been initialized.
Please feel free to run some benchmarking tests of RoadRunner+Ubiquity vs NGINX+Ubiquity or Apache+Ubiquity. Preliminary tests have shown more than 100% increase in the number of requests per second and twice quicker response time.
Changelog
Changelog can be found here.
License
This is open-sourced software licensed under the MIT License.