I am using out of the box Laravel 9 / php 8.1 combo and loading initial page for 190ms sounds horrible. Last project I built used laravel7 and the response times in development including database queries - talking complex ones were less than 20ms
Currently I am trying to set it up, so the tests were simply loading the default route or just a route returning a string.
I tested several instances
- Custom docker container I've built (amazonlinux, php81, php81-fpm / nginx ) on an old server
- Local Windows 10 instance / php81 / artisan serve
- Pre-built container by bitnami
All of them showed responses ranging from 80ms to 2200ms
- My custom container because of the optimizations showed responses of 60ms - 80ms, but on the 3rd-4th refresh it pulled a 450-900ms response time
- On Windows 10 instance there was stable response, but horribly slow ~85-130ms
- Pre-built container was also stable on around 190ms
You can understand the horror as those are simply empty frameworks deployed.
My test case where a database from another container was pulled to select 1-100 records didn't change the response times. Database was pulled in less than 10ms.
For comparison, because I started reviewing php-fpm configuration (still out of the box on all test cases) I ran some benchmarks if this is the bottleneck, but it was performing flawless. Ops/sec were as described on normal php8.1 benchmarks
Strange thing I've noticed was within Xdebug on my custom container, there were 2300 more records below this.