Monitor detached child processes with pm2
Asked Answered
K

1

8

I have a pretty data heavy Node application. Besides common things like file uploading, the app also spawns detached (long running) child processes.

For an example, consider a user uploads a file and the detached process triggers a native tool installed on the system to do some heavy processing. This can take anywhere between a second and several minutes - therefore the process is detached and the user is notified within the web site (when online) or via email.

I'm considering to use pm2 as monitoring tool. It seems great, though how would I monitor individual detached child processes with it? I've read most of the docs and checked the code examples - but I didn't find an example for my particular problem.

Concrete config examples will be welcome, since I'm new to pm2.

Koetke answered 13/11, 2016 at 20:34 Comment(1)
I'm using pm2.launchBus() to create a socket between the parent and child process. There is very little documentation on launchBus() but it sounds like that is what you need. Did you ever find a solution?Lastex
W
1

As of November 2020, there is an open issue for this feature: https://github.com/Unitech/pm2/issues/1869

Windpipe answered 9/11, 2020 at 12:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.