-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lots of <defunct>
processes when using Cron
#368
Comments
We had exactly the same issue with laravel tasks with background mode activated. Without the background mode, all work properly. If i well understood, Shopware use a symfony stack and there is no background feature by default (or i don't know it). Maybe Shopware added it ? BTW, to fix it I'm working on a feature to have a proper deamon supervisor who can help the daemon killer to work better for v5. Until that i recommand to look about a feature related to a background mode. If nothing work, let's me know (i'm curious about this defect) but for instance i don't have any better solution than restart the container. |
Thanks for your feedback @mistraloz ! Well, I'm also not too deeply involved in the implementation details of Shopware 5 but I can definitely check if they're using the Symfony Background feature. Since we're planning to upgrade to Shopware 6 within the next year, I'm not sure if it's worth spending too much time on this. It's rather a consideration if you expect more applications running in your container environment which are using that Symfony feature. For the time being I just restart the container on a regular basis. Thank you for your help and I will keep you posted here if I have further information! |
Hi, first of all: thanks for these great images, I really love them an use them a lot!
Problem definition
In one of my prod instances I'm using the image to run Shopware 5 in a Docker container. The system uses cron jobs to execute background jobs, so I'm using a
docker-compose
configuration like this:Which creates the following
/tmp/generated_crontab
in the container:After some days, my monitoring system complained about the increasing number of threads my server is using. I figured out, that these threads are related to zombie processes, which are obviously created by the containers Cron system. So if I check the processes from inside the container via
I get a lot of these entries:
(note the 5 minutes difference which is exactly the cron frequency).
So to me it looks like the process started by
sudo -E -u www-data -- bash -c 'php bin/console sw:cron:run'
is never really properly closed. Killing them manually is not possible because we'd need to kill the parent process, which is the containers root process with pid1
.Any ideas? Thanks for your help!
Possible Solution
Did not find a workaround to get rid of all the
defunct
processes, yet. Think the only way would be to restart the container on a regular basis.Your Environment
The text was updated successfully, but these errors were encountered: