I have been doing local replicating from one pool to another within my system and with the many dataset present I had accumulated 1000's of snapshot. I was running replication using Freenas replication GUI, but I couldn't understand why it would literally take hours for maybe a few hundred snapshots to replicate, some well actually most of them reporting no significant change in size. So I tried a manual incremental replication of the same dataset and I noticed was a huge performance increase. Roughly one 312B stream per second versus maybe several minutes through GUI.
I believe that maybe the script running the replication is based on a timed event and pulls the status of the replication task at a fixed interval maybe once a minute or longer, or simply browsing through the entire snapshots recursively is what's taking time.
Some abstract of the 'messages' files in ./system/syslog/log contains the following:
Code:
Aug 25 22:00:21 freenas autorepl.py: [common.pipesubr:58] Popen()ing: /usr/bin/ssh -ononeenabled=yes -ononeswitch=yes -i /data/ssh/replication -o BatchMode=yes -o StrictHostKeyChecking=yes -o ConnectTimeout=7 -p 22 localhost "zfs list -Hr -o name -t snapshot -d 1 western-backup/Media_library/Photo | tail -n 1 | cut -d@ -f2"
Aug 25 22:00:21 freenas autorepl.py: [common.pipesubr:72] Executing: /usr/bin/ssh -ononeenabled=yes -ononeswitch=yes -i /data/ssh/replication -o BatchMode=yes -o StrictHostKeyChecking=yes -o ConnectTimeout=7 -p 22 localhost "/sbin/zfs inherit freenas:state western-backup/Media_library/Photo@auto-20140823.2142-2w"
Aug 25 22:00:21 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs inherit freenas:state WD-RAIDZ2/Media_library/Photo@auto-20140823.2112-2w
Aug 25 22:00:22 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs release -r freenas:repl WD-RAIDZ2/Media_library/Photo@auto-20140823.2112-2w
Aug 25 22:00:22 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs set freenas:state=LATEST WD-RAIDZ2/Media_library/Photo@auto-20140823.2142-2w
Aug 25 22:00:22 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs hold -r freenas:repl WD-RAIDZ2/Media_library/Photo@auto-20140823.2142-2w
Aug 25 22:02:45 freenas autorepl.py: [common.pipesubr:58] Popen()ing: /usr/bin/ssh -ononeenabled=yes -ononeswitch=yes -i /data/ssh/replication -o BatchMode=yes -o StrictHostKeyChecking=yes -o ConnectTimeout=7 -p 22 localhost "zfs list -Hr -o name -t snapshot -d 1 western-backup/Media_library/Photo | tail -n 1 | cut -d@ -f2"
Aug 25 22:02:45 freenas autorepl.py: [common.pipesubr:72] Executing: /usr/bin/ssh -ononeenabled=yes -ononeswitch=yes -i /data/ssh/replication -o BatchMode=yes -o StrictHostKeyChecking=yes -o ConnectTimeout=7 -p 22 localhost "/sbin/zfs inherit freenas:state western-backup/Media_library/Photo@auto-20140823.2143-2w"
Aug 25 22:02:45 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs inherit freenas:state WD-RAIDZ2/Media_library/Photo@auto-20140823.2142-2w
Aug 25 22:02:46 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs release -r freenas:repl WD-RAIDZ2/Media_library/Photo@auto-20140823.2142-2w
Aug 25 22:02:46 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs set freenas:state=LATEST WD-RAIDZ2/Media_library/Photo@auto-20140823.2143-2w
Aug 25 22:02:46 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs hold -r freenas:repl WD-RAIDZ2/Media_library/Photo@auto-20140823.2143-2w
Aug 25 22:05:07 freenas autorepl.py: [common.pipesubr:58] Popen()ing: /usr/bin/ssh -ononeenabled=yes -ononeswitch=yes -i /data/ssh/replication -o BatchMode=yes -o StrictHostKeyChecking=yes -o ConnectTimeout=7 -p 22 localhost "zfs list -Hr -o name -t snapshot -d 1 western-backup/Media_library/Photo | tail -n 1 | cut -d@ -f2"
Aug 25 22:05:07 freenas autorepl.py: [common.pipesubr:72] Executing: /usr/bin/ssh -ononeenabled=yes -ononeswitch=yes -i /data/ssh/replication -o BatchMode=yes -o StrictHostKeyChecking=yes -o ConnectTimeout=7 -p 22 localhost "/sbin/zfs inherit freenas:state western-backup/Media_library/Photo@auto-20140823.2213-2w"
Aug 25 22:05:07 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs inherit freenas:state WD-RAIDZ2/Media_library/Photo@auto-20140823.2143-2w
Aug 25 22:05:08 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs release -r freenas:repl WD-RAIDZ2/Media_library/Photo@auto-20140823.2143-2w
Aug 25 22:05:08 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs set freenas:state=LATEST WD-RAIDZ2/Media_library/Photo@auto-20140823.2213-2w
Aug 25 22:05:08 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs hold -r freenas:repl WD-RAIDZ2/Media_library/Photo@auto-20140823.2213-2w
Aug 25 22:07:29 freenas autorepl.py: [common.pipesubr:58] Popen()ing: /usr/bin/ssh -ononeenabled=yes -ononeswitch=yes -i /data/ssh/replication -o BatchMode=yes -o StrictHostKeyChecking=yes -o ConnectTimeout=7 -p 22 localhost "zfs list -Hr -o name -t snapshot -d 1 western-backup/Media_library/Photo | tail -n 1 | cut -d@ -f2"
Aug 25 22:07:29 freenas autorepl.py: [common.pipesubr:72] Executing: /usr/bin/ssh -ononeenabled=yes -ononeswitch=yes -i /data/ssh/replication -o BatchMode=yes -o StrictHostKeyChecking=yes -o ConnectTimeout=7 -p 22 localhost "/sbin/zfs inherit freenas:state western-backup/Media_library/Photo@auto-20140823.2214-2w"
Aug 25 22:07:29 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs inherit freenas:state WD-RAIDZ2/Media_library/Photo@auto-20140823.2213-2w
Aug 25 22:07:30 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs release -r freenas:repl WD-RAIDZ2/Media_library/Photo@auto-20140823.2213-2w
Aug 25 22:07:30 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs set freenas:state=LATEST WD-RAIDZ2/Media_library/Photo@auto-20140823.2214-2w
Aug 25 22:07:30 freenas autorepl.py: [common.pipesubr:72] Executing: /sbin/zfs hold -r freenas:repl WD-RAIDZ2/Media_library/Photo@auto-20140823.2214-2w
These snapshots are the one that will most likely produce a stream of 312B.
What is it about the GUI replication function that take so much time compare to a zfs send -I ... | zfs recv .... command line?