1

I've a jenkins server and running a lot of CPU bound compilations. I want to change the scheduler from SCHED_NORMAL to SCHED_BATCH. I know it can be done with chrt but I want the system to use it by default for all jenkins jobs (and perhaps all processes on the system).

How can I set SCHED_BATCH to be the default?

iveqy
  • 111
  • 1

1 Answers1

3

You can modify the systemd unit which starts Jenkins to set the CPU scheduling policy, using CPUSchedulingPolicy=.

Sets the CPU scheduling policy for executed processes. Takes one of other, batch, idle, fifo or rr. See sched_setscheduler(2) for details.

So you might create a drop-in for your Jenkins systemd service with a path such as /etc/systemd/system/jenkins.service.d/scheduler.conf:

[Service]
CPUSchedulingPolicy=batch
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972