Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laptrinhcomvn/3af7c0fd66c4a515348258e9ebdd3103 to your computer and use it in GitHub Desktop.
Save laptrinhcomvn/3af7c0fd66c4a515348258e9ebdd3103 to your computer and use it in GitHub Desktop.
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 http://domain1.com (use whatever domain name you have available)
4. Create http://domain2.com (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: https://github.com/laurencei/benchmark-laravel
8. gitclone to Domain 2: https://github.com/laurencei/benchmark-lumen
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 https://domain1.com/
ab -n 1000 -c 10 https://domain1.com/user/1/
ab -n 1000 -c 10 https://domain1.com/user/post/
// Laravel (api)
ab -n 1000 -c 10 https://domain1.com/api/
ab -n 1000 -c 10 https://domain1.com/api/user/1/
ab -n 1000 -c 10 https://domain1.com/api/user/post/
// Lumen
ab -n 1000 -c 10 https://domain2.com/
ab -n 1000 -c 10 https://domain2.com/user/1/
ab -n 1000 -c 10 https://domain2.com/user/post/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment