lichess-org / fishnet

Distributed Stockfish analysis for lichess.org
https://lichess.org/get-fishnet
GNU General Public License v3.0
738 stars 102 forks source link

Lower CPU priority #252

Closed obj-obj closed 1 year ago

obj-obj commented 1 year ago

Fixes #251

I also ran cargo update during this PR, I can remove the changes to Cargo.lock if it's a problem

niklasf commented 1 year ago

Hi. Thanks, and sorry for the late review. Which platform did you run this on? Is this priority reliably inherited by processes spawned later on the same thread?

obj-obj commented 1 year ago

Hi. Thanks, and sorry for the late review. Which platform did you run this on? Is this priority reliably inherited by processes spawned later on the same thread?

Tested on Linux, priority was inherited on the stockfish processes. Not sure about Windows/Macos, but I'd imagine it works the same (unless priority isn't inherited for some reason).

niklasf commented 1 year ago

Ok, cool. I added an optional --cpu-priority unchanged flag (f99905f1fab643d01297bb26a53a44127db33405), just in case someone needs the old behavior, or prefers setting the priority with nice(1) or via systemd.