I am in the process of migrating our Laravel application to EKS Kubernetes which is currently running on Docker however the response time is significantly slower.
The current response time is roughly (Docker): 350-450 ms
The new response time is roughly (Kubernetes): 750-1100 ms
Notable Environment Differences:
APM Findings:
I am running DataDog which shows that a lot of time is being spent on Laravel, rather than DB or Redis which doesn't give me much to work with.
At this point, I am thinking it is infrastructure related rather than an issue with Laravel as the Docker environment already preforms (decently).
I am running this as an init container (which occurs every deployment or pod restart):
php artisan opcache:clear
php artisan route:cache
php artisan config:clear
php artisan config:cache
php artisan view:clear
php artisan view:cache
php artisan opcache:compile --force
php artisan migrate --force
php artisan db:new_seed
php artisan queue:restart
I am unsure where to start troubleshooting. Any advice will be helpful.