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?

11
  • You could use nice to set process scheduling. See man nice for more info.
    – Panki
    Commented Nov 24, 2020 at 11:48
  • Do you have a single core CPU? Commented Nov 24, 2020 at 11:55
  • nice could be useful too, but here it seems you need ionice because the perfomance degredation you see is probably more I/O usage related than CPU. Related: unix.stackexchange.com/questions/437977/…
    – thanasisp
    Commented Nov 24, 2020 at 11:56
  • @ArtemS.Tashkinov 8 core (i7), but still it lags
    – HelloWorld
    Commented Nov 24, 2020 at 13:33
  • 1
    thanasis solution worked like fire.
    – HelloWorld
    Commented Nov 24, 2020 at 15:59

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .