tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

fsync, rdiff-backup, wapbl, and WD Elements 1T drive



netbsd-5, i386, 2 x 400G SATA in rf RAID1, external USB2 WD Elements 1T

I have a UFS2+WAPBL filesystem on the above RAID1 with ~900K files in
~320GB.  I'm backing it up with rdiff-backup to a USB2 external disk.
The external disk has a single large UFS2+WAPBL partition.

I found that backups took crazy long -- as in most of a week -- when not
that many of the files had changed.  The rdiff-backup process was often
in tstile or xscmd, but continue to apparently make progress.  The disk
busy % on both the RAID1 and external USB2 drive was only around 30%,
but any use of disks was very very slow.  If I suspended rdiff-backup,
all seemed well, and I saw ~30 MB/s bulk read with dd and several
hundred tps with du.

With ktrace, I found that rdiff-backup seems to do fsync on every file,
and each fsync takes most of a second.  Other than that ktrace events
happen in quick succession.

With (yes, I know I'm living dangerously, and the machine is on a UPS):
  sysctl -w vfs.wapbl.flush_disk_cache=0
I am seeing about 11 transactions flushed per second (via
  sysctl -w vfs.wapbl.verbose_commit=1
), and typically 300 tps and 3 MB/s on the USB2 disk.  In 15 minutes the
processed-file count has gone up 10K, vs 25K in about 4 hours.
The previous backup of a smaller fs did 230K files in 18h.

So things are still slow, but much better.

I have run rdiff-backup from a remote machine (with
host::/mnt/rdiff-backup/foo/bar as target), and that has seemed to be
ok, processing a 300G filesystem (on which not much changes) in about an
hour, via a 10 Mb/s network connection to a net5501 (lame USB) with a
similar disk.  I haven't looked yet, but it seems that rdiff-backup must
not do fsync when using the ssh backend.

So, I'm inclined to patch rdiff-backup not to fsync, since it seems
excessive, and the backup is toast if the machine crashes before it is
finished -- in that case rdiff-backup just rolls back.  Opinions?

I also wonder if we should have a vfs.wapbl.honor_fsync sysctl.  But it
seems the real issue here is fsync when there shouldn't be fsync, and
such a sysctl seems a bit scary and otherwise unncessary.

Attachment: pgpiBsXujJtLn.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index