Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This is referring to the matter stated here and I am also experiencing the same.

In one of my servers, I ran an rsync, to backup a huge directory (size greater than 300 Gb) to a different disk, mounted on same machine. The directory being rsynced contains thousands of directories and files. I issued a single rsync command, with 'nohup' and then pushed it in background using the '&' command. The complete command given on the remote bash shell (using putty) was:

nohup rsync -avh /some/local/dir /backup/ >> /opt/rsync.dec22.log &

Then just to check at what rate was the data being copied, I used 'iotop' command, and found that there were 3 rsync running with same parameters. On searching I found the link above which says that it is normal.

But doing an iotop to monitor only those and the only rsync processes running on the system, I see that one process is reading files, one is writing them, but one is idle. The behaviour seems to be good, as one process doing only one thing at a time, but what is the 3rd process doing (seen as the middle one in the image below)?

The iotop command I had used was:

iotop -p22250 -p22251 -p22252

Here is the screenshot for the iotop command output:

iotop command output showing 3 rsync process

I am asking this cause I use rsync a lot, and want to understand its behaviour for long term benefit. I even read the manual, but it says nothing of the forking.

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

rsync is a program designed to be a client and server. The server reads and the client writes. Imagine that instead of a single computer, you had computers over network, I'm sure it's lot more clear if you think that way.

Then there is the controller. As IO operations tend to come with certain amount of risk, an IO issue shouldn't cause total blocking or a crash. So, it creates a fork for each connection and sits in the background.

share|improve this answer
    
Thanks for knowledge. I understand it in the view of separate computers on network, each computer doing a part of the work in sync. But can you also refer me to the behaviour documentation where I can read more such stuff about rsync and also about the concept? Also would like to know how is the read data passed by the reading process to the process which is writing? Is the concept of IPC being used? –  Gautam Somani Dec 24 '12 at 4:44
1  
@GautamSomani The official rsync page will be your best source for such. rsync.samba.org Also, the how it works is available here: rsync.samba.org/how-rsync-works.html If you want even further details, you probably have to dig into the source. –  Grumpy Dec 24 '12 at 5:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.