# RSYNC:  ssh vs rsyncd

## jbain

I'm setting up some load balancing web servers and I'm going to be using Rsync to synchronise my files so that each each contains the right, up-to-date information.

Performance wise which would be more efficient: using rsync over ssh? or using an rsync server? Is there much of a difference in bandwidth? memory/cpu usage? efficiency? or even security? though the securty shouldn't be to much of an issue as all the replication will happen over a private lan between the servers.

----------

## liber!

Obvious the diference will be security, a ssh tunnel is muche safer.

It'l also use with ssh a bit more processing power, but not very noticable...

Greets,

 Nathan

----------

## kashani

Depends on a few factors, but I'd say unless you've got a very specific setup rsync over ssh is going to be your best bet.

why you might want to ssh

1. It's secure

2. rsync servers have had a number of exploits

3. ssh-keys make authentication much better and easier

4. don't have to create lots of mount point if you're trying to control access

why rsyncd might make more sense

1. single user enviroment, ie they are all your companies machines and you are the only group allowed on them... no customers

2. You want to do many many sync per day and need to cut down overhead

3. You are moving lots and lots of data

4. All this is internal to your network

5. your servers are highly loaded

I'll give some examples of situations I've seen

Customer sets cron to sync once per 15 minutes on a 40GB website. rsync isn't even done building the file list in 12 minutes when the servers are busy busy. Had words with said customer and change rsync to 10am 1pm and 6pm. Things returned to normal.

Very busy video server dropping rsync due to weird IP stack issues and latency. Changed head end to rsyncd and dropped ssh. That improve speed slightly and more rsyncs completed then before. Also I'm the only guy who needs or has access so I didn't have to worry about creating a mount for each customers' data.

In summary, unless you really really need the cycles ssh is easy, safer, and works well enough. I would change your ssh_config and sshd_config to prefer blowfish encryption which tends to be faster than AES or RSA. It's noticably increased speeds at several of my previos jobs' environments.

edit for horrible grammar

kashani

----------

