Skip to content
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

Zombie process #89

Closed
kouinkouin opened this issue Oct 3, 2022 · 2 comments
Closed

Zombie process #89

kouinkouin opened this issue Oct 3, 2022 · 2 comments
Milestone

Comments

@kouinkouin
Copy link

kouinkouin commented Oct 3, 2022

Hi,

First, thanks for the image :-) .

After a run (via docker-compose), I got a zombie process "epmd".
Here a part of my ps faux (from the host):

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
...
root     15977  0.0  0.1 108688  4912 ?        Sl   10:07   0:00  \_ containerd-shim -namespace moby -workdir /var/lib/containerd/io.containerd.runtime.v1.linux/moby/cc2a0ed780c67b4fd321e4610b0cb8e227559cd5e0cf697ecc6166587969d3ee -address /run/containerd/containerd.sock 
-containerd-binary /usr/bin/containerd -runtime-root /var/run/docker/runtime-runc
9000     15994  115  2.1 1180848 86984 ?       Ssl  10:07   0:31      \_ /home/ejabberd/bin/beam.smp -K true -P 250000 -- -root /home/ejabberd -progname erl -- -home /home/ejabberd -- -sname ejabberd@localhost -boot_var RELEASE_LIB ../lib -smp enable -noshell -kernel inet
_dist_listen_min 4370 inet_dist_listen_max 4379 -mnesia dir "/database/ejabberd@localhost" -ejabberd log_rotate_size 10485760 log_rotate_count 1 -s ejabberd -noshell -noinput
9000     16068  0.0  0.0      0     0 ?        Zs   10:07   0:00          \_ [epmd] <defunct>
9000     16069  0.0  0.0    876   428 ?        S    10:07   0:00          \_ /home/ejabberd/bin/epmd -daemon
9000     16082  0.0  0.0    788   492 ?        Ss   10:07   0:00          \_ erl_child_setup 1048576
9000     16148  0.0  0.0    788     4 ?        Ss   10:07   0:00              \_ /home/ejabberd/lib/eimp-1.0.22/priv/bin/eimp
9000     16149  0.0  0.0    788     4 ?        Ss   10:07   0:00              \_ /home/ejabberd/lib/eimp-1.0.22/priv/bin/eimp
9000     16150  0.0  0.0    788     4 ?        Ss   10:07   0:00              \_ /home/ejabberd/lib/eimp-1.0.22/priv/bin/eimp
9000     16151  0.0  0.0    788     4 ?        Ss   10:07   0:00              \_ /home/ejabberd/lib/eimp-1.0.22/priv/bin/eimp
9000     16216  0.0  0.0    812     4 ?        Ss   10:07   0:00              \_ inet_gethost 4
9000     16217  0.0  0.0    812    40 ?        S    10:07   0:00              |   \_ inet_gethost 4
9000     16268  0.0  0.0    812    40 ?        S    10:07   0:00              |   \_ inet_gethost 4
9000     16220  0.0  0.0    784     4 ?        Ss   10:07   0:00              \_ /home/ejabberd/lib/os_mon-2.7/priv/bin/memsup

In a docker top ejabberd, the zombie process doesn't appear:

UID                 PID                 PPID                C                   STIME               TTY                 TIME                CMD
9000                15994               15977               10                  10:07               ?                   00:00:34            /home/ejabberd/bin/beam.smp -K true -P 250000 -- -root /home/ejabberd -progname erl -- -home /home/ejabberd -- -sname ejabberd@localhost -boot_var RELEASE_LIB ../lib -smp enable -noshell -kernel inet_dist_listen_min 4370 inet_dist_listen_max 4379 -mnesia dir "/database/ejabberd@localhost" -ejabberd log_rotate_size 10485760 log_rotate_count 1 -s ejabberd -noshell -noinput
9000                16069               15994               0                   10:07               ?                   00:00:00            /home/ejabberd/bin/epmd -daemon
9000                16082               15994               0                   10:07               ?                   00:00:00            erl_child_setup 1048576
9000                16148               16082               0                   10:07               ?                   00:00:00            /home/ejabberd/lib/eimp-1.0.22/priv/bin/eimp
9000                16149               16082               0                   10:07               ?                   00:00:00            /home/ejabberd/lib/eimp-1.0.22/priv/bin/eimp
9000                16150               16082               0                   10:07               ?                   00:00:00            /home/ejabberd/lib/eimp-1.0.22/priv/bin/eimp
9000                16151               16082               0                   10:07               ?                   00:00:00            /home/ejabberd/lib/eimp-1.0.22/priv/bin/eimp
9000                16216               16082               0                   10:07               ?                   00:00:00            inet_gethost 4
9000                16217               16216               0                   10:07               ?                   00:00:00            inet_gethost 4
9000                16220               16082               0                   10:07               ?                   00:00:00            /home/ejabberd/lib/os_mon-2.7/priv/bin/memsup
9000                16268               16216               0                   10:07               ?                   00:00:00            inet_gethost 4

ejabberd/ecs is the only container with zombie processes.
Has someone an idea to suppress/fix the process?

@badlop
Copy link
Member

badlop commented Oct 3, 2022

epmd is used by the erlang node that contains ejabberd for clustering and accepting ejabberdctl queries. So, it's normal to have epmd running at the same time that the beam process.

What does annoy you is to have a defunct epmd?

epmd is started automatically by erlang when the erlang node is being started, and keeps alive even when the erlang node is stopped. For that reason, the ejabberdctl script attempts to kill epmd when ejabberd stops, but maybe it didn't succeed in your case.

By the way, using recent Erlang versions it's possible to use erlang without epmd. Support for that was recently added to ejabberd, see 30f1e284681db482ef78da6d865ccc79120e4ca3 and the GHCR image 5ee1dc9e8d80d52ec9f3dd3f043dfdd4c90c303a.

@kouinkouin
Copy link
Author

Thanks for the explanation and the link to the doc.
But I am alone with the issue? You (or someone else) have not the case?
If not, I will try to compare with a clean config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants