Last week I bought a new HDD for one friend and I started a rsync process on my tiny home-server to copy some stuff – it was around 190 GB of different stuff.
This command looks very simple and without unnecessary options but my 400 MHz CPU was pretty quick hot and I got a Kernel Panic:
rsync -a /opt/Samba/PublicShare /mnt/
My next step was to try to run the rsync operation with less CPU-resource than normal are used.
I tried to set process priority of my process with nice.
In Linux all processes have a priority, its a number between -20 and 19. The value of -20 is the highest, and 19 is the lowest priority.
The minus -20 value required the most CPU resources, the positive value like 10 are plenty slow but are using less CPU-resources.
The standard priority is: 0
Process priority can be set with the nice command:
nice -n 10 rsync -a [...] nice -n 20 rsync -a [...]
If you already started a process (by default it will run with priority 0) you can set the priority afterwards.
Do do this you need the PID of the process, with ps ax | grep smbd you can find process PID.
Set a new priority to PID 1768:
renice -20 1768
You will get a status message: 1768: old priority 19, new priority -20
Leave a Reply