Skip to content

Lapinskas/roadrunner-ubiquity

Repository files navigation

RoadRunner and Ubiquity Integration

Version

Makes the fastest PHP framework even faster.

Installation

$ composer require lapinskas/roadrunner-ubiquity

Dependencies

Composer

Get Composer 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

Ubiquity Framework

Install Ubiquity Framework using Composer

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

Require RoadRunner - Ubiquity integration

Reqire this package via composer

$ composer require lapinskas/roadrunner-ubiquity

RoadRunner installation

The following command will automatically download latest binary executable to the project folder and copy necessary files.

$ vendor/bin/rr-ub-install

Run RoadRunner

Start 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

Version Release date

Changelog can be found here.

License

License

This is open-sourced software licensed under the MIT License.