magento-cloud-docker icon indicating copy to clipboard operation
magento-cloud-docker copied to clipboard

Cron container runs out of memory

Open MagicLegend opened this issue 2 years ago • 0 comments

Preconditions

  1. Use --with-cron to generate configs
  2. I'm gonna assume a default Magento won't have this issue, but our installation has about 30 packages in the composer.json, so not a big store imo.

Steps to reproduce

  1. Start the containers
  2. Start the cron (make sure it's enabled in env.php - otherwise you'll be searching like me why it's not working since it's not mentioned in the docs...)
  3. Observe the log file

Expected result

  1. Happy cron jobs

Actual result

  1. Sad cron jobs

image

What can be investigated is why the cron job thinks it only has 2MB of memory, when PHP was configured for 2GB.

Solution

  1. Allocate more memory to the cron by changing the CRONTAB environment to:
CRONTAB: '* * * * * root cd /app && /usr/local/bin/php -d memory_limit=-1 bin/magento cron:run >> /app/var/log/cron.log'

MagicLegend avatar May 03 '22 07:05 MagicLegend