-
Notifications
You must be signed in to change notification settings - Fork 37
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
Consider using pidtree package #20
Comments
😲 That's amazing! I'm guessing @pkrumins wrote it that way because, that's just what he thought up at the time? I'd be interested in a PR that replaces the current logic with 'pidtree'. We would have to release it as a semver major version, though just in case. (When you have over 100,000 downloads a day and zero regression tests... it's good to be cautious.) Edit: Hah I just saw that https://github.com/Unitech/pm2/pull/3554/files basically IS such a PR. Very interesting! |
Yes kind of. |
Never merged? |
And IIRC he implemented taskkill and it's really performant. |
I'll work on this as soon as possible, right now I'm a bit busy. |
Currently this package recursively kill processes level by level spawning the
ps
orpgrep
a lot of times.I've built this package that maybe can help to improve performance.
https://github.com/simonepri/pidtree
My benchmarks shows that is really fast (~5-10 ms per call regardless of how big the sub-tree is) but I don't know if it would be adapt for the use of this package.
What's the advantage of calling
ps
orpgrep
multiple times instead of parsing the tree just callingps
once? Memory efficiency? Or it was just simpler to implement?See also:
Unitech/pm2#3554 (comment)
cc: @soyuka
The text was updated successfully, but these errors were encountered: