Keywords: Magento - AWS - Technical issue - Other
bnsupport ID: 26d7b0ac-d785-453c-1794-a44c1905b46d
I have a Magento server on AWS (Lightsail) running Magento 2.3.2. Cron jobs don't seem to have been configured by default. That's not a huge issue, I can add them to the cron tab. Using instructions here (https://community.bitnami.com/t/magento-2-cron-on-aws-not-running/64697/4) I decided to try executing the three cron processes at the command line just to make sure there would be no issues once they were added to the crontab.
sudo /opt/bitnami/apps/magento/htdocs/bin/magento-cli cron:run -vvv 2>&1
Response is "Ran jobs by schedule." No issues, CPU usage remains normal.
sudo /opt/bitnami/php/bin/php /opt/bitnami/apps/magento/htdocs/update/cron.php 2>&1
Runs with no issues. CPU remains normal.
sudo /opt/bitnami/apps/magento/htdocs/bin/magento-cli setup:cron:run -vvv 2>&1
This causes .php-fpm.bin to begin to consume 100% (or close) of one of my server's cores. It also causes me to be unable to access my Magento store through a web browser. I've allowed this to continue for over eight hours to see if the server just has to work through something, but after eight hours it was still running at a high load.
I have not yet launched the site, so there is no traffic other my own, so I've excluded server load as a cause. I began to suspect that the cause was a high level of backed up jobs in the cron_schedule table, so I completely cleared the table and tried again. The same issue occurred. If I reboot the server after executing this command, .php-fpm.bin just picks up where it has left off. I end up just restoring the server from a snapshot to resolve the issue.
The server otherwise performs well with minimal CPU load and is quite responsive.
Does setup:cron:run execute anything not contained in cron_schedule? Are there other obvious areas I could check to try to understand what is happening?