From 52a3eafede649386c448239536013e941548dc68 Mon Sep 17 00:00:00 2001 From: Jan Niggemann Date: Sat, 23 Sep 2017 19:32:07 +0200 Subject: [PATCH] doc: FAQ: Add info on IO and CPU prioritization --- doc/faq.rst | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/doc/faq.rst b/doc/faq.rst index b0e8495aa..74b4f8795 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -49,3 +49,43 @@ implementing unattended backups happens in :issue:`533`. root). .. _accessible only to that user: https://security.stackexchange.com/questions/14000/environment-variable-accessibility-in-linux/14009#14009 + +How to prioritize restic's IO and CPU time +------------------------------------------ + +If you'd like to change the **IO priority** of restic, run it in the following way + +:: + +$ ionice -c2 -n0 ./restic -r /media/your/backup/ backup /home + +This runs ``restic`` in the so-called best *effort class* (``-c2``), +with the highest possible priority (``-n0``). + +Take a look at the `ionice manpage`_ to learn about the other classes. + +.. _ionice manpage: https://linux.die.net/man/1/ionice + + +To change the **CPU scheduling priority** to a higher-than-standard +value, use would run: + +:: + +$ nice --10 ./restic -r /media/your/backup/ backup /home + +Again, the `nice manpage`_ has more information. + +.. _nice manpage: https://linux.die.net/man/1/nice + +You can also **combine IO and CPU scheduling priority**: + +:: + +$ ionice -c2 nice -n19 ./restic -r /media/gour/backup/ backup /home + +This example puts restic in the IO class 2 (best effort) and tells the CPU +scheduling algorithm to give it the least favorable niceness (19). + +The above example makes sure that the system the backup runs on +is not slowed down, which is particularly useful for servers.