-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Option to run process with a nice level (Linux), or lower priority (Windows) #2304
base: nightly
Are you sure you want to change the base?
Conversation
…ority to nice(10) on Linux, and BELOW_NORMAL in Windows
Requesting a review from @chazlarson as he will maybe know more about this than I do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems harmless, but needs docs.
@planetrocky can you add an entry to the https://github.com/Kometa-Team/Kometa/blob/nightly/docs/kometa/environmental.md#width |
Also, is there an env var version? Are there any complications when running in docker? |
Also is there a "high priority" method or a way to set a percentage of priority? |
|
I held-off editing that, wasn’t sure if I should or not. Yes I was going to add WiKi, waiting to see if this PR might go forwards :) |
KOMETA_ environment variables are automatically created in |
Docker processes can lower their priority - there’s nothing special required. CAP_NICE feature is required for a Docker container to set a negative NICE value (high priority above normal) a as that’s normally a root privilege.
It would complicate user’s Docker setup, in that the I did consider allowing a value to be specified. My thoughts:
Most of my delay is SQLite inside Plex. I’d love to move Plex to Postgres. |
Thanks. I missed that in my checking. I setup a clean Python virtual environment to test. I’ll check it! |
I bring up the docker situation because people will enable it and then ask about it if it doesn't behave as expected. If there are things that need to be in place for this to make sense in Docker then that needs to be documented either along with the flag and/or in the docker install notes. |
Seems like that will drive different requirements for linux/osx/docker vs win, which will be another documentation point and will touch all the install docs. |
As is; nothing changes, lowering process priority on Docker isn’t privileged - same as a normal user can “nice” their process. However adding an option for high priority would require changes - and I’d recommend not providing that! :) |
I’ll have a think about it. I find the ability to lower the priority (nice) very useful. My Kometa has had this change locally for a long time now. I could just keep as a local patch; but I thought others might find this useful. Especially if running on an under powered NAS. |
I am not arguing against it or commenting on the utility of the change at all, just pointing out things that will come up.
Apparently this may not be an issue:
|
I'd already tested the code on Linux and Windows; the conditional Yes! I was just about to post the same. :) |
No absolutely! Totally understand. BTW I've been coding since computer programming was punching holes in cardboard! :) |
removed unused win32con module.
|
Just for clarification:
And I know it's obvious, but I would highlight that runtimes may be impacted if the user chooses to run it at a lower priority. |
doc adjustments WIP - awaiting further updates from OP
@planetrocky any updates on this please? |
Description
I've been running this locally since June, and find it useful as it takes hours to full-scan TV Shows.
Add process priority run command
--nice/-ni
.This sets process priority to
nice(10)
on Linux, andBELOW_NORMAL
on WindowsType of Change
Checklist
Kometa Wiki would need updating, if this PR is accepted.