zeldor.biz

Linux, programming and more

Copyright © 2025
Log in

Linux Process Control

July 5, 2012 by Igor Drobot Leave a Comment

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:

1
rsync -a /opt/Samba/PublicShare /mnt/

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:

1
2
nice -n 10 rsync -a [...]
nice -n 20 rsync -a [...]

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:

1
renice -20  1768

renice -20 1768

You will get a status message: 1768: old priority 19, new priority -20

Nice nicing;)

Filed Under: Debian, Kernel, Linux, Ubuntu Tagged With: nice, PID, priority, Process, renice, rsync

Categories

Archives

Tags

apache2 Apple arduino ARM Automation backup bash Cisco Cluster Corosync Database Debian Debian squeeze DIY DNS Fedora FTP Fun Icinga Ipv6 KVM Linux LVM MAC OS X Monitoring MySQL Nagios Nginx openSUSE OpenVPN PHP Proxy Python python3 qemu RAID rsync Samba security ssh Ubuntu virtualization Windows Windows 7 Wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *

Yeaaah Cookie! We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok