load average based scheduling

30 views
Skip to first unread message

Wayne Moore

unread,
Feb 2, 2024, 7:00:43 PMFeb 2
to boinc_dev
I'm thinking about taking on this

Client
  1. Change prefs from "if CPU load > X, suspend works" to "if CPU load is X, use N-X CPUs".
The goal is to run ans much boinc as possible without boinc pushing the load average over threshold. I was thinking along the lines of
load = 0;
load2 = 0;
tick(cpu,time)
{
  usage = cpu/time;
  x = exp(-time/TIME_CONSTANT);
  load = x * load + (1 - x) * usage;
  load2 = x * load2 + (1 - x) * usage * usage;
  sd = sqrt(load2 - load * load);
  if (load > threshold + sd)
    if(boinc_running())
      stop_one_boinc();
  if (load < threshold - 2 * sd)
    if (boinc_waiting())
      start_one_boinc();
}

In theory I know how to get (cpu,time) on ubuntu/debian mac and windows but I don't have a Mac development environment and haven't done windows system programming in decades.

Wayne Moore

unread,
Feb 4, 2024, 8:07:50 PMFeb 4
to boinc_dev, Wayne Moore

seems to work quite nicely on Linux and Windows. I stole the Apple code and can't test it, but it looks reasonable. Don't know about other Unices.

Interestingly it works correctly even in a Docker container, with no special privileges, at least on Linux.

Wayne Moore

unread,
Feb 5, 2024, 7:07:20 PMFeb 5
to boinc_dev, Wayne Moore
I have a patched client running now and it works quite well. Keeps the load around 6 (out of 12) where I set it. Running in a container.

Wayne Moore

unread,
Feb 7, 2024, 1:18:18 AMFeb 7
to boinc_dev, Wayne Moore
FWIW It now will not start jobs unless the cpu_temp < cool_enough and will shed jobs if cpu_temp > too hot, at least on Linux. I understand from the comments someone has done this on Mac. I does not appear to be possible on Windows without an insane amount of work.
Reply all
Reply to author
Forward
0 new messages