magento-cloud-docker
magento-cloud-docker copied to clipboard
Cron container runs out of memory
Preconditions
- Use
--with-cron
to generate configs - 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
- Start the containers
- 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...) - Observe the log file
Expected result
- Happy cron jobs
Actual result
- Sad cron jobs
What can be investigated is why the cron job thinks it only has 2MB of memory, when PHP was configured for 2GB.
Solution
- 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'