Laravel production optimisation, load testing and monitoring
When pushing your new app into production there are always stages you should follow to ensure there is no end user issues.
Here is a list of what I do, if you have others please leave in the comments.
- Use the most recent version of PHP
- Enable opcache
- Make sure your DB uses indexes where appropriate
- Cache results of expensive queries and computations
composer install -a --no-dev
php artisan optimize
- Remove dependencies you don't need
- Disable service providers you don't need
- Disable middleware you don't need
- Use a fast cache/session/queue/whatever driver (Redis)
- Queue tasks that don't need to run synchronously
- Optimize your DB queries: Use eager loading, don't fetch stuff you won't need,
EXPLAIN your queries etc.
A product I use to test load is. JMeter