We have set up a kubernetes cluster for our laravel application on google cloud platform. Containers:
(We run under nginx-ingress-controller but this seems unrelated to the issue)
We run a jmeter stress tests on a simple laravel route that returns "ok" and we noticed terrible response times.
Afterwards we run the same test on an index2.php (inside public dir το slide over the framework) which just returns 'ok'.
After digging we found out that the composer's autoloading stuff cause this slowness.
Any advice on how this could be resolved will be highly appreciated.
Thanks
Ok. We found out that we had no opcache enabled. As documented about composer optimize-autoloader:
On PHP 5.6+, the class map is also cached in opcache which improves the initialization time greatly. If you make sure opcache is enabled, then the class map should load almost instantly and then class loading is fast.