In this post, I’m comparing Laravel 6, 7 and 8 with PHP 7.2 and PHP 7.4. Why not include PHP 8? PHP 8 still new and its just slightly faster (not much) than 7.4. This benchmark test is tested against my existing live application.
Note that, this load test is based on 4 Core 8 GB Ram and dockerized in serverless Alibaba Cloud. Result will based on single replica only.
Before that I would like to share the configuration used,
Server specification
- Dockerized — 4C 8G each
- Database RDS Mysql — 16C 32G
- Redis Server — 8C 16G
Docker
For Laravel 6, I using 2 different docker to test PHP 7.2 and PHP 7.4
FROM webdevops/php-nginx:7.2
FROM webdevops/php-nginx:7.4
For Laravel 7 & 8, only docker PHP 7.4
FROM webdevops/php-nginx:7.4
You can refer here — https://github.com/webdevops.
Nginx Configuration
nginx.conf
....
worker_connections 4096;
...
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
send_timeout 300;
proxy_buffering off;
....