vbauer / manet

Website screenshot service powered by Node.js, SlimerJS and PhantomJS
MIT License
576 stars 102 forks source link

Defunct process leading high CPU usage #97

Open L3o-pold opened 5 years ago

L3o-pold commented 5 years ago

After some usage, seems that manet will let some zombie process. It leads to high CPU usage after some times.

Here is an example of a manet instance runned since 2 hours.

ps -aux

root 1 0.1 0.3 939332 65224 ? Ssl 14:21 0:06 node /usr/local root 398 0.0 0.0 0 0 ? Z 14:28 0:00 [node] <defunct root 405 0.0 0.0 0 0 ? Z 14:28 0:00 [phantomjs] <de

I saw this thread that could help https://stackoverflow.com/questions/37825670/why-nodejs-spawn-process-become-defunct-until-parent-exited.

I am not sure how to fix it, and I couldn't reproduce this behavior outside of our production environment (xenial/puppet with docker and nodejs:8 official image).