magento / magento/magento-cloud-docker

Cron container runs out of memory

Open
#347 0 comments 0 reactions 0 assignees View on GitHub

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
  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'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.