PHP cloud hosting comparison (OpenShift vs Heroku vs Fortrabbit)

I want PHP 5.6+, so I did some basic testing of those services to pick cheep and good solution to host my blog.
OpenShift because I use it and it's free for 3 small gears, it was pretty good solution few years ago.
Heroku because I used it for Ruby on Rails projects and they support multiple languages (even multiple build packs for one project)!
I used FortRabbit too, so I decided to test theirs new apps.


I used basic Laravel 5.2 with tree routes for this test:

  • / - Default route that ships with Laravel installation
  • /test - Hits method on TestController, pass one var to view and render it
  • /info - This route call phpinfo()

TL;DR

Just compare FortRabbit's and Heroku's features and prices and chose one of them.
I prefer Heroku, but it was easier to transfer to FortRabbit because of MySQL support.
You know what, I'll probably continue further research and probably transfer to Heroku or something else (eg. Digital Ocean VPS and deploy with Deployer). Right now FortRabbit is much better solution than OpenShift, step in right direction :)

OpenShift PHP 5.4 and Laravel 5.0 (current setup) vs FortRabbit PHP 5.6 and Laravel 5.2 (future setup)

OpenShift

"There ain't no such thing as a free lunch"

I'm not sure about paid version but they simply don't maintain their service. It's all about OpenShift v3 these days... But it's free, so I decided to give it a try and benchmark this setup against other opponents.

pros:

  • Free for 3 small gears
  • MySQL 5.5 with 1GB of storage (use 1 of your 3 gears)
  • Don't require any payment information for free plan
  • Simple cronjob support via predefined file structure

cons:

  • Idles after 24 hours
  • First request after idle almost always fails
  • You have to use 3rd party cartridges for beyond outdated default cartridges

Results (Nginx & PHP 5.6.16 @ free OpenShift - 3 gears scaled):

Path Concurrency Requests Requests/sec Failed requests Fastest request[ms] Slowest request [ms]
/ 5 100 10.91 0 419 1384
/ 10 1000 6.17 0 1036 6971
/test 5 100 9.4 0 510 821
/test 10 1000 6.3 0 1095 6790
/info 5 100 7.54 87 628 1901
/info 10 1000 3.38 95 3292 6539

Complete results files:

Heroku

If you ever worked with Rails you probably have some experience with Heroku. It's probably first service with git deploy I used.
They provide support for multiple languages, and even Apache or nginx servers for PHP. By default Heroku setups your app to use PHP 7, but you can specify desired version in composer.json and they will use that version. Also you have to setup default build pack manually or Heroku may make wrong assumption because of package.json. You have control over your services trough Procfile to set web or worker or anything else.
Main issue when transferring live project is eventual migration from MySQL to PostgreSQL if you want to stick with Heroku's default stack.

pros:

  • Up to date stack
  • Support multiple languages
  • You can use multiple build packs (eg. PHP and Node.js)
  • PostgreSQL support
  • GUI for ENV var
  • Support cron jobs via add ons
  • Fair pricing for smaller project, starts at $9

cons:

  • Don't support MySQL by default (you have to use 3rd party add-ons)
  • Free plan idles after 30 minutes
  • Free plan must idle at least 6 hours per day
  • For custom domain setup you have to provide payment information, even for free plan (and custom domain is free feature)

Results (Apache & PHP 7.0.1 @ free Heroku):

Path Concurrency Requests Requests/sec Failed requests Fastest request[ms] Slowest request [ms]
/ 5 100 36.62 0 119 254
/ 10 1000 83.18 0 110 1260
/test 5 100 33.64 0 121 1169
/test 10 1000 41.27 0 158 2626
/info 5 100 7.54 82 511 672
/info 10 1000 10.11 773 859 15192

Complete results files:

FortRabbit

This is PHP exclusive stack, with git deploy and it's pretty good one. New apps are great, but they lacks some features too.

2016-01-22 Update:
FortRabbit support workers for new apps now.

pros:

  • Up to date stack
  • MySQL support
  • GUI for managing PHP ini and PHP version
  • GUI for ENV var
  • Fair pricing for smaller projects, starts at 7€ (5€ app server + 2€ MySQL)

cons:

  • Don't provide free plan, so you have to pay even for testing
  • Currently don't support cron jobs, or workers, it's in development for new apps, but you can check one of the links here
  • No SSH access, so you cant run artisan commands

Results (Apache & PHP 5.6 @ 7€ instance):

Path Concurrency Requests Requests/sec Failed requests Fastest request[ms] Slowest request [ms]
/ 5 100 29.28 0 109 687
/ 10 1000 75.4 0 114 1539
/test 5 100 42.94 0 104 281
/test 10 1000 67.62 0 118 1328
/info 5 100 9.5 9 504 1822
/info 10 1000 9.49 105 902 12822

Complete results files:

Complete results on same instance with PHP 7.0:

Complete results on same 35€ instance with PHP 7.0: