plotng icon indicating copy to clipboard operation
plotng copied to clipboard

Add Nice config option to lower chia processes priority

Open carlosvsilva opened this issue 3 years ago • 4 comments

Hi. I'm using chia under plotng on a desktop machine, and would welcome an option in config file to give a "nice" priority to chia processes, so that they won't be as heavy penalizers and impact interactive GUI sessions as much. Can you please add this option for a "nice" value (i think they go from 19 to -20), 19 the lowest, and -20 the highest. I'd like to set all chia plotting processes to something like 10 so that the normal 0 priority processes don't get bogged by Chia.

Thanks

carlosvsilva avatar May 26 '21 20:05 carlosvsilva

I second this. Some other scripts already do it and feels smooth to use the computer while plotting.

giordanidev avatar May 26 '21 21:05 giordanidev

Sorry, but this is a Windows Task Manager option, not available to the programming API I am using.

maded2 avatar May 27 '21 02:05 maded2

And in Linux, doesn't it work? I guess there must be some kind of way to specifiy it. Last resort, just invoking "nice chia " will do the job. Thanks.

carlosvsilva avatar May 27 '21 03:05 carlosvsilva

I'm not super familiar with process priorities but I found this thread which is for linux. And the documentation of the same thing for Windows.

cmd := exec.Command("chia", args...)

# linux
err = syscall.Setpriority(cmd.Process.id, who int, prio int)

# windows
err = windows.SetPriorityClass(process handle, priorityClass uint32)

Not sure if syscall.Setpriority works for Mac OS or not.

torrayne avatar May 27 '21 18:05 torrayne