magento / magento/magento-cloud-docker
Cron container runs out of memory
Open
Nobody has claimed this yet.
Progress: ready for grooming
- Dominant language
- PHP
- Stars
- 277
- Forks
- 187
- PR merge metrics
- No merged PRs in 30d
Description
Preconditions
- Use
--with-cronto 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
CRONTABenvironment to:
CRONTAB: '* * * * * root cd /app && /usr/local/bin/php -d memory_limit=-1 bin/magento cron:run >> /app/var/log/cron.log'
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the --with-cron generated configuration, env.php, and the CRONTAB environment command; compare the memory limit used by the cron container with PHP's configured 2GB limit. Reproduce with an installation containing additional Composer packages and verify that cron no longer reports a 2MB limit, using the documented memory_limit=-1 command only as a reference workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, php
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100