hello everyone!!!
im back at yall again with yet another question!
closing in my nix misadventures by finally setting up a remote builder… ive begun to think about performance. i mean, i have both shitty and insane computers, and it is only now that ive suddenly started to care about SPEED.
so, ive seen(1) some(2) posts(3) about these fairly new little options:
nix.daemonIOSchedClass
nix.daemonCPUSchedPolicy
nix.daemonIOSchedPriority
nix.settings.cores
nix.settings.max-jobs
and it involves math. OBVIOUSLY. but the more i started reading about it, the less it made sense to me - “should i even change anything”? also, the words are too technical, maybe its too early for me to try this? anyway, i think people are giving different advice to the same thing!
BEFORE i had a dedicated computer on which i update/compile/build stuff (aka a remote builder), i was doing everything on a laptop (well, actually a steam deck, but thats besides the point, but if youre curious, it was surprisingly cool with nixOS, ha, get it?) - watching youtube, gaming and rebuilding! i did NOT have any performance loss DURING any builds, though… HOWEVER, now that i know that those options exist - am i missing out (should i even care about these options and who are these for, actually)?
should i, in the case of having only A-not-so-necessarily-“desktop”-computer, where i do absolutely everything (i.e. a regular ass user), where i do not care about battery or other bits and bobs, but do care about maximum performance, speed, FAST… set every nix scheduler to LOW, potentially sacrificing building speed, or should i set it to HIGH, minimising the amount of time it takes to finish, but rendering the computer utterly useless at the same time? hmm, now that i think about it… it really depends, is it not? what if i want to update as FAST as possible, giving away ALL of the computer’s resources?
ugh. it sounds so stupid, i know, i apologise. the way these options are explained are extremely, excrutiatingly difficult for someone with autism ("best-effort"
, "idle"
, "other"
, "batch"
, etc.). but bear with me: then, what about the opposite?
i have a HANDHELD device, i care about its battery, longevity, health. but it is a GAMING device (!). in this case, is it valid to keep the settings as default? as in, “it only matters DURING the compilation, and you are completely mistaken, you should completely ditch this idea and ignore those options forever, besides you shouldve at least attempted to calculate the ratio of jobs to cores!!!”
BUT! THIRD CASE: finally, what if i have a remote builder? if the build-process-daemon-thingie has nothing to do with this machine, do i have to adjust its scheduler or not? i think that sounds like a good question.
just wanted to ask this for people in the future, cos lots of folks have slowdowns, hangs and whatnot everytime something is updating. well, actually, i just wanna know if itll have any noticeable impact on OVERALL performance OUTSIDE of building/compiling/updating.
so, for 4
cores, 8
threads, i have calculated that the best values are…
nix.settings.cores = 4
nix.settings.max-jobs = 1
wait. that cant be right, can it? did i miss something, or…? do they also count towards threads or only logical cores? so… i should be having just 1 simultaneous build task at ONCE? but… right now, with the default settings, i have 4? the buildPhase
thing, right? i have 4 of these at the same time, which is pretty slow for me… one buildPhase
at once would fit me better, so, once again, i am very confused: what values should those settings be (not just cores
and max-jobs
, but also the scheduling thingies)?
EDIT: oh btw speaking of concurrent tasks. is it possible somehow to change the amount of SIMULTANEOUS DOWNLOADS per build/update? because with my network, the fastest way to download things is to NOT “parallel” it, but rather to download them one by one, and that’d sort it out, i think! thanks in advance!!! (edit2: for example with nh helper tool, is there a way?)
its so embarrassing. perhaps, especially since im trying to achieve something impossible here, right?
thank you guys for any help in advance
i love asking embarrassing questions!