Laravel Benchmark with Locust

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,

  • Dockerized — 4C 8G each
  • Database RDS Mysql — 16C 32G
  • Redis Server — 8C 16G

For Laravel 6, I using 2 different docker to test PHP 7.2 and PHP 7.4

For Laravel 7 & 8, only docker PHP 7.4

You can refer here — https://github.com/webdevops.

nginx.conf

gzip.conf

default.conf

php.ini

Process manager config

Opache

Running the Load Test

Based on above command, I run the Locust load testing individually for 200 users first and followed by 300 concurrent users.

Result

Conclusion

This is just based on my experience. Feel free to comment and discuss. If you want to try to load test your own system with locust, feel free to see my article on how to load test in Locust

Thank for your time~~ #sharingexperience

Software Engineer at Teratotech.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store