1

I currently tar -cvf a 600gb folder, on the background, without compression.

I noticed that my ubuntu lags so much during this process, that it becomes practically unusable. When I top I see that

60% of my CPU is taken a mount.ntfs command and 15% of my CPU by the tar.

How can I limit the CPU usage of those two to let's say 30% and 10%, so that I can actually use my system at the same time?

HelloWorld
  • 1,355
  • 2
  • 6
  • 11

1 Answers1

2

The slowdown is more probably caused by the disk usage rather than CPU usage. tar massively reads and writes for the 600G directory. See also related post.

As the tar process is already running, you have to get its pid, using pidof tar or ps aux | grep tar and renice its I/O priority to class 3.

-c, --class name or number of scheduling class, 0: none, 1: realtime, 2: best-effort, 3: idle

ionice -c3 -p <pid>

This will also make the archiving take longer, as it will use the disk only when it is not being used by other programs.

thanasisp
  • 7,802
  • 2
  • 26
  • 39