scx/services
Pietro Righi 66dea6262b scx.service: allow overriding scx variables
Switching the scheduler requires changing SCX_SCHEDULER (and potentially
also SCX_FLAGS) in /etc/default/scx.

This patch allows overriding these settings using systemd environment
variables SCX_SCHEDULER_OVERRIDE and SCX_FLAGS_OVERRIDE, without
changing the default configuration.

Example:

 > grep SCX_SCHEDULER /etc/default/scx
 SCX_SCHEDULER=scx_rusty

 > sudo systemctl status scx
 ...
   Main PID: 8021 (scx_rusty)
 ...

 > sudo systemctl set-environment SCX_SCHEDULER_OVERRIDE=scx_rustland
 > sudo systemctl restart scx
 > sudo systemctl status scx
...
   Main PID: 4021 (scx_rustland)
...

This feature can be useful for quickly testing different schedulers and
settings, without altering the global system configuration.

Signed-off-by: Pietro Righi <pietro.righi.email@gmail.com>
2024-06-14 18:51:11 +02:00
..
openrc services/openrc: symlinking fix 2024-04-03 22:02:14 +02:00
systemd scx.service: allow overriding scx variables 2024-06-14 18:51:11 +02:00
README.md Update README.md 2024-01-27 00:59:23 +01:00
scx scheds: Add scx_mitosis scheduler to /etc/default/scx 2024-06-11 23:05:17 +02:00

A Quick Start Guide

This guide provides instructions for running the SCX schedulers as a systemd service and checking its logs.

Getting Started

At the very beginning, configure the /etc/default/scx file:

  • in the SCX_SCHEDULER variable, select the scheduler you are interested in

  • in the SCX_FLAGS variable, specify the flags you want to add. To do this, execute and read what flags you can add.

scx_SCHEDNAME --help

To start the SCX scheduler at boot, you need to run the systemd service as root. Here are the steps:

  • Enable the service:
systemctl enable scx.service
  • Start the service:
systemctl start scx.service

Alternatively, you can use a shortened version of these commands:

systemctl enable --now scx.service
  • To check the status of the service, use the following command:
systemctl status scx.service

Checking Journald Logs

The SCX schedulers do not log to the default journald namspace. Instead, they save logs in a dedicated sched-ext namespace. This is where you should look for information about possible errors.

  • To view the logs, use the following command:
journalctl --namespace=sched-ext
  • To find logs from another system startup and identify when a potential error might have occurred, use:
journalctl --namespace=sched-ext --list-boots
  • To verify the amount of space taken up by the logs, use:
journalctl --namespace=sched-ext --disk-usage