Laravel vs Lumen benchmarking

Recently I have almost completed a web application based on laravel. Before deploying the application to production server I was just checking the laravel and lumen performance. I have used apache load test tool ab

After installing a fresh Lumen, make a route which return a response like Hello world. To get a correct benchmark value, I have performed every benchmark test for five time and pick the average value. I'll provide concurrency level as 10 and time for test as 10 seconds.

# Requests/Sec
1 3052.37
2 3042.90
3 3008.43
4 3062.69
5 3043.56

So for the fresh Lumen the number of requests per second was 3041.99

Then I have installed a fresh Laravel and did the above operation:

# Reqests/Sec
1 610.59
2 510.69
3 395.70
4 344.83
5 334.59

For the fresh Laravel the number of requests per second was 439.28

It seems Lumen really faster than Laravel!! What the hack laravel doing? I am going to use Lumen for my api based application... wait a minute why there is so much different?

Though we have used the fresh installation but lumen does not load facade, Authenticate middleware, eloquent etc by default. Now I'm going to uncomment two lines from bootstrap/app.php file


$app->withFacades();

$app->withEloquent();

Now I'll follow the same procedure

# Requests/Sec
1 2066.10
2 2078.71
3 2085.13
4 2083.82
5 2089.64

Oops.. It's quite slower to process requests, now the number of requests per second is: 2080.68 _

So when you are using micro-mini application then Lumen may be a better solution.

Benchmarking machine configuration I have used:

  • Dell inspiron 14 5000 series, Core i5 (5th generation), RAM: 8GB, Hard disk 7200 rpm (5,400 RPM)
  • Apache/2.4.18
  • PHP Version 7.0.8-0ubuntu0.16.04.2
  • OS: Ubuntu 16.04.2

results matching ""

    No results matching ""