Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Lumen vs Laravel performance steps
Steps to recreate tests:
// Create and configure server:
1. Create 2GB DigitalOcean server using Forge
2. Enable OpCache on server
3. Create (use whatever domain name you have available)
4. Create (use whatever domain name you have available)
5. Enable SSL on both domains using LetsEncrypt
6. Install: sudo apt-get install apache2-utils
// Install packages
7. gitclone to Domain 1:
8. gitclone to Domain 2:
9. Composer install on both domains
10. Set .env on both packages to use "Redis" for sessions and cache
11. Both domains: php artisan migrate --seed
12. On Domain1 only run "php artisan config:cache" and "php artisan route:cache"
13. Restart opcache: "echo "" | sudo -S service php7.2-fpm reload"
// Run EACH test below FIVE times and average the results
// Laravel (web)
ab -n 1000 -c 10
ab -n 1000 -c 10
ab -n 1000 -c 10
// Laravel (api)
ab -n 1000 -c 10
ab -n 1000 -c 10
ab -n 1000 -c 10
// Lumen
ab -n 1000 -c 10
ab -n 1000 -c 10
ab -n 1000 -c 10

This comment has been minimized.

Copy link

tg44 commented Sep 13, 2018

Would be better with another -n and -c values. If we have bigger data to work with our numbers will correlate better to the truth.

I just run this against my akka-http helthcheck endpoint, and

  • with 1000/10 (local-to-local) I get 428.92 [#/sec] (mean) 23.314 [ms] (mean) 2.331 [ms]
  • with 10000/100 (local-to-local) I get 1197.71 [#/sec] (mean) 83.493 [ms] (mean) 0.835 [ms]
  • with 1000/1 (local-to-local) I get 1458.72 [#/sec] (mean) 0.686 [ms] (mean) 0.686 [ms]
  • with 1000/10 (local-to-remote) I get 43.37 [#/sec] (mean) 230.578 [ms] (mean) 23.058 [ms]
  • with 1000/1 (local-to-remote) I get 6.97 [#/sec] (mean) 143.477 [ms] (mean) 143.477 [ms]

(my remote is a lowcost dev env and my local internet provider give us an unreliable service, I measured more then 4k req/sec in a single machine with the same backend when my loaders was on multiple machines but in the same network as the server)

Which means that the numbers you get with the measures are really "depends on" the testing method. (just see the req/sec differences in the 3 local-to-local measure...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.