-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Pass CPU priority for process #1253
Comments
I don't think there is a way to do this at the moment. |
You can do this with linux command "nice"
start app.js in lowest priority [high -20..19 low] but have not figured out a way to do this with pm2 or while node is running do renice -n 19 -p [pid] |
@ageorgios same way without pm2:
|
I have done this in the nodejs it self, using the below script as I required a my nodejs script to be run as low priority process always. I did not want to write additional bash script to handle every restart of my low priority task.
|
Bump. Any plans for this? |
I really think it's definitely not a good thing to let PM2 or a process decide CPU priority. @Unitech @soyuka @vmarchaud : do you have an opinion ? |
I had built a package named "renice" because I though it'd be okay to add a "renice" command in pm2: https://github.com/soyuka/renice/blob/master/index.js (May 25, 2016, few days after this issue opened haha) In fact this is just a convenient multi-os wrapper (haven't tested it for now cause I wasn't sure it'd be useful). I don't see why we could not add this command to the list. To me this subject is the same as "adding startup methods for every supported OS embed in pm2" (ie pm2 startup). |
One of the main things I do is to directly start node processes -- there's no external script to set the |
see this too -- #3912 |
I came up with a simple way to do it with nodejs.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Seems we can use Please make this natively supported. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I would also need this as well. Use case: a pretender process (Chrome headless) is using a lot of CPU. Decreasing its priority sounds like a solution |
Then again, if you have a modern nodejs version use |
Even though we could do it within the node file, it would be great to make it configurable from one - to configure the cluster, worker count, and priority all together... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Bump to remove stale... |
Came here looking looking for this exact same thing. Seems critical. |
How I can register process low or high CPU priority?
The text was updated successfully, but these errors were encountered: