www mirror: is dnotify / rsync my best bet?
Hi all -
I have twin web servers (FC1) that are pseudo loadbalanced via DNS round robin. I need a way to replicate new content to both servers instantly. So far I have come up with this.
Run at startup:
dnotify -MCDRB /webroot -e /rsync-script &
The /rsync-script will simply propogate changed files from the first webserver over to the second fairly instantaneously, using rsync.
The only thing im uneasy about is having the /rsync-script invoked every time a file is transferred via FTP to the first server. During the transfer of some smaller files, this couldmean the script is run hundreds of times a second. Even If it does run reliably at that speed, I think I may run into problems because dnotify will invoke rsync at the end of every file transfer, yet rsync will attempt to transfer all files that have changed. It is my understanding that dnotify can not specify which individual files have changed in a directory - only that files ave indeed changed, so we cant just transfer them one at a time.
Does anyone else have a more elegant solution to this problem?
Thanks so much,