Categories: Learn Laravel Tutorials, Tips And Guides

Benchmarking Laravel 5.5: Performance Testing on PHP 7.0 and 7.1

Laravel performance testing is an important aspect of the growth of the framework. Developers in particular need to checkout benchmarking numbers because of the direct impact on application performance.

Laravel 5.5 benchmarks for PHP 7.0 and 7.1 is a hot topic in the industry because of the popularity of Laravel for web projects. So I decided to test it for for both PHP 7.0 and PHP 7.1. For the purpose of this article, I decided to use a Laravel single page app with Vue.js. To replicate the numbers, you could use any other Laravel app. (however, note that your results could vary).

This test was conducted using Apache Benchmark.


For the purpose of this tutorial, I assume that you have a Laravel application installed on a web server. My setup is:

First Case

  • Cloudways Managed Linode server : 2GB
  • Datacenter: Bangalore
  • PHP 7.0
  • No caching libraries
  • No of Users: 50, Requests 500-1000
  • Laravel 5.5 with PHP 7.0

Second Case

  • Cloudways Managed Linode server : 2GB
  • Datacenter: Bangalore
  • PHP 7.1
  • No caching libraries
  • No of Users: 50, Requests 500-1000
  • Laravel 5.5 with PHP 7.1

Now, to simplify the process, I decided that I don’t want to deal with server management issues. In addition, I needed a dependable stack that supports both versions of PHP and Laravel. Since Cloudways offers this combination, I hosted the test app on the platform. If you wish to replicate the test, I strongly recommend signing up for a free Cloudways account and then follow the GIF for server and app setup:

Here is a list of active services on the server:

Laravel 5.5 & PHP 7.0 Benchmark: 500 Requests & 50 Concurrent Users

Fire up the SSH terminal and go to public_html folder. Type the following command:

ab -k -n 500 -c 50 http://phplaravel-144478-440242.cloudwaysapps.com/

Upgrade the PHP Version

Cloudways sets 7.0 as the default PHP version. However, you could easily change the PHP version by going to Settings & Packages tab and then change the version from the relevant dropdown.


Laravel 5.5 & PHP 7.1 Benchmark: 500 Requests & 50 Concurrent Users

For the next part, enter the following command in the SSH terminal:

ab -k -n 500 -c 50 http://phplaravel-144478-440242.cloudwaysapps.com/

In a Nutshell

The Laravel performance test generated the following statistics

Sno Parameters Laravel 5.5 + PHP 7.0 Laravel 5.5 + PHP 7.1
1 Region Bangalore Bangalore
2 Concurrency Level 50 50
3 Time Take For Test 9.928 seconds 10.007 seconds
4 Complete Requests 500 500
6 Total Transferred [bytes] 1881630 1881751
7 Keep ALive Requests 483 489
8 Request Per Second 50.36 49.96
9 Time Per Request 992.874 ms 1000.707 ms
10 Time/Request [mean ms](mean across concurrent users) 19.857 20.014

Wrapping it Up

From this Laravel 5.5 benchmark results, it is clear that it performed very similar on PHP 7.0 and 7.1. This shows that the developers do not have to worry about the performance of their Laravel apps on either of the two PHP versions.However , Laravel 5.5 has handle slightly more request with 7.0 as compared to PHP 7.1.


Please Retweet if you liked this article, and don’t hesitate to follow me on Twitter. Thanks for reading.

Pardeep Kumar :Pardeep is a PHP Community Manager at Cloudways - A Managed PHP Hosting Platform. He love to work on Open source platform , Frameworks and working on new ideas. You can email him at pardeep.kumar@cloudways.com