Consent to the use of Personal Data and Cookies

This website needs your consent to use cookies in order to customize ads and content.

If you give us your consent, data may be shared with Google.

Worker stopped due to memory limit of x bytes exceeded

This problem can occur when you have a typo in the memory-limit part of your messenger:consume call.

8 views

Edited: 2022-10-18 13:34

12:37:21 INFO [messenger] Worker stopped due to memory limit of 1024 bytes exceeded (44564480 bytes used)

This error can show up when messenger:consume is called with a typo in the --memory-limit part of the command, and it might not be easy to track down when controlling your workers with supervisor.

When specifying a memory limit, always remember include a size unit at the end. M for megabytes is most often used. If no size unit is present, bytes is assumed, resulting in the limit of x bytes exceeded error.

You ought to pick a memory limit that at least matches the minimum requirements of your application. For Shopware 6 this is 512M.

When using supervisor, an obvious symptom is that the individual processes will exit very quickly, or they might continuously restart, with little indication as to what is going on.

A working messenger-consume.conf for supervisor might look like this:

command=php /var/www/shopware/bin/console messenger:consume default --time-limit=600 --memory-limit=1024M
user=www-data
numprocs=2
autostart=true
autorestart=true
process_name=%(program_name)s_%(process_num)02d

This should be placed in /etc/supervisor/conf.d/.

Tell us what you think:

  1. How to disable certain Exception error messages in Shopware, so that redundant messages do not show up in the log file.
  2. Running messenger:consume workers with a time limit can be useful, but you should also not set it too low.
  3. If shopware is stuck in maintenance mode, make sure to delete the update fulder and disable maintenance mode manually.
  4. How to use the watch scripts to preview changes without having to recompile everything.
  5. How to fix an obscure error from supervisor with the .sock file.

More in: Shopware