Interview Prep/Linux/Processes, services and systemd

You need to temporarily run a command with a lower I/O priority so a backup doesn't hurt the database. How?

IntermediateScenarioProcesses, services and systemd
Answer

Situation read → CPU and I/O niceness, or cgroup I/O weights.

What I'd do →

nice -n 19 ionice -c3 tar -czf /backup/data.tgz /data
# or with cgroups:
sudo systemd-run --scope -p IOWeight=10 -p CPUWeight=10 tar -czf /backup/data.tgz /data

Why → ionice -c3 (idle class) only gets disk time when nobody else wants it; cgroup weights work on cgroup v2 with any I/O scheduler that supports them.

Interview tip → Mention that ionice classes depend on the I/O scheduler; IOWeight is the more modern approach.

All Linux questions Roadmap: Linux

More on Processes, services and systemd