Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

admin@iphonephotographyschool.com's avatar

Running Laravel queue on supervisor eats up all docker container memory

Hi!

I have following supervisor setup for running the queue:

[program:laravel-worker-emails]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/artisan queue:work database --queue=emails --memory=128 --sleep=3 --tries=3 --daemon
autostart=false
autorestart=true
user=root
numprocs=6
redirect_stderr=true
stdout_logfile=/var/log/laravel-queue-worker-emails.log

What happens is - queue worker slowly eats up all memory (docker container has 2 GB of it) but it shouldn't as I have defined 128 * 6 = 768 MB memory limit. When I restart the supervisor processes, things go back to normal for a while ( https://imgur.com/a/mIw1O restarting shown in graph with red arrows). Container does not have incoming web traffic, only processing jobs from database table and sending POST requests to external email service. We didn't have such problem when running Laravel on Forge.

Setup: Multi-container Laravel 5.2. docker app on AWS Elastic Beanstalk. Any ideas why and how to fix this?

0 likes
0 replies

Please or to participate in this conversation.