If you feel the performance of your site is slow or if believe there are issues affecting the performance of your site. We recommend carrying out the following checklist as we find this fixes/identifies most problems.
1. Site Cache
Check that all caches are enabled. because of opcache this needs to be done in two places.
- Log in via ssh and run `php bin/magento cache:status`
If any caches are reported as off enable them (`php bin/magento cache:enable`) - Log into the MAP (Magento Admin Panel) go to system => cache management
If any caches are marked as off, you will need to clear opcache. This can be done via Toolbelt => Actions => Flush Opcache
2. Running Requests
This should identify the currently running requests, if there are a lot this indicates processes hanging
Log in via ssh and run `mdoq-running-php-requests` this will give you the number of running requests, if this is more then 5 it indicates a lot of traffic or requests are taking a long time to complete.
3. PHP-FPM Max Children
Production sites should be on static, depending on the hosting package you have chosen, the number of children should change**.
Log in via SSH, and run `ps aux | grep 'php-fpm: pool' | wc -l` if the value returned is less then 5 please reach out to our support to get assistance to configure this.
** - subject to fair use, if you are using our shared hosting (any package under medium) we don't expect more then 5 workers. If it is identified that this has been set higher, this will incur charges.
4. Number of requests / Cache Hit Rate
This should help you identify the total requests (and therefore average requests per min / per sec for the day) as well as the hit rate.
Log in via ssh
`wc -l mdoq/var/log/nginx/*8080.access.log` - this will tell you the number of requests that weren't cached (got past varnished)
`wc -l mdoq/var/log/nginx/*443.access.log` - this will tell you the total number of requests handled so far today.
Request Per second = total requests / (hours of the day * 3600)
NB total requests can be the cached or uncached figure
Cache hit rate = (uncached request / total requests) * 100
A good target is 70%, anything significantly less than this indicates poor application cache configuration. (ie a module or block invalidating cache or a lot of requests bypassing cache)
If you want to watch the requests getting passed varnish you can run `tail -f mdoq/var/log/nginx/*8080.access.log`
5. Error Rate
A high error rate will cause performance issues. A high rate of errors indicates problems these problems will likely have a performance impact.
Log in via SSH
` wc -l var/log/exception.log` - this will tell you the number of application errors. We would expect this to be < 100 for a day.
If the directory `var/report` exists, `ls -1 var/report | wc -l` - this will tell you the number application exceptions, We would expect this to be < 10 for a day
`wc -l mdoq/var/log/php-fpm/error.log` - the number of fatal errors, we would expect this to be 0.
` wc -l mdoq/var/log/nginx/*error.log` - request errors, we would expect this to be as low as possible.