Skip to contentSkip to conversation

split RAID1 during backups?

DISCUSSION Jeff Breidenbach 6 participants 6 messages Oct 24, 2005 – Oct 27, 2005 MD RAID

lore
Share & tools
lore
#0 lore raw

Hi all,

I have a two drive RAID1 serving data for a busy website. The partition is 500GB and contains millions of 10KB files. For reference, here's /proc/mdstat

Personalities : [raid1]
md0 : active raid1 sdc1[0] sdd1[1]

      488383936 blocks [2/2] [UU]

For backups, I set the md0 partition to readonly and then use dd_rescue
+ netcat to copy the parition over a gigabit network. Unfortuantely, this process takes almost 10 hours. I'm only able to copy about 18MB/s from md0 due to disk contention with the webserver. If I had the full attention of a single disk, I could read at nearly 60MB/s.

So - I'm thinking of the following backup scenario. First, remount /dev/md0 readonly just to be safe. Then mount the two component paritions (sdc1, sdd1) readonly. Tell the webserver to work from one component partition, and tell the backup process to work from the other component partition. Once the backup is complete, point the webserver back at /dev/md0, unmount the component partitions, then switch read-write mode back on.

Am I insane?

Everything on this system seems bottlenecked by disk I/O. That includes the rate web pages are served as well as the backup process described above. While I'm always hungry for perforance tips, faster backups are the current focus. For those interested in gory details such as drive types, NCQ settings, kernel version and whatnot, I dumped a copy of dmesg output here: http://www.jab.org/dmesg

Cheers,
Jeff

#1 lore raw
Quoted 9 lines

Hi all,

I have a two drive RAID1 serving data for a busy website. The partition is 500GB and contains millions of 10KB files. For reference, here's /proc/mdstat

Personalities : [raid1]
md0 : active raid1 sdc1[0] sdd1[1]

Quoted 7 lines
      488383936 blocks [2/2] [UU]

For backups, I set the md0 partition to readonly and then use dd_rescue
+ netcat to copy the parition over a gigabit network. Unfortuantely, this process takes almost 10 hours. I'm only able to copy about 18MB/s from md0 due to disk contention with the webserver. If I had the full attention of a single disk, I could read at nearly 60MB/s.

First of all, if the data is mostly static, rsync might work faster. Don't feed rsync millions of files in one go - try to split it in separate processes for say all files starting with a, all files starting with b etc.

Quoted 9 lines

So - I'm thinking of the following backup scenario. First, remount /dev/md0 readonly just to be safe. Then mount the two component paritions (sdc1, sdd1) readonly. Tell the webserver to work from one component partition, and tell the backup process to work from the other component partition. Once the backup is complete, point the webserver back at /dev/md0, unmount the component partitions, then switch read-write mode back on.

Am I insane?

It doesn't sound insane. If it's actually fast, is something only you can test on your hardware.

By the way, it used to be with regular IDE disks that using hdc and hdd together on a single wire was a sure way to get a slow system. I take it sdc and sdd using SATA don't influence each other?

Good luck,
Jurriaan

#2 lore raw
In reply to Jeff Breidenbach
Quoted 7 lines · Jeff Breidenbach

So - I'm thinking of the following backup scenario. First, remount /dev/md0 readonly just to be safe. Then mount the two component paritions (sdc1, sdd1) readonly. Tell the webserver to work from one component partition, and tell the backup process to work from the other component partition. Once the backup is complete, point the webserver back at /dev/md0, unmount the component partitions, then switch read-write mode back on.

Why not do something like this ?

mount -o remount,ro /dev/md0 /web
mdadm --fail /dev/md0 /dev/sdd1
mdadm --remove /dev/md0 /dev/sdd1
mount -o ro /dev/sdd1 /target

<do backup here>

umount /target
mdadm -add /dev/md0 /dev/sdd1
mount -o remount,rw /dev/md0 /web

That way the web server continues to run from the md..
However you will endure a rebuild on md0 when you re-add the disk, but given everything is mounted read-only, you should not practically be doing anything and if you fail a disk during the rebuild the other disk will still be intact.

I second jurriaan's vote for rsync also, but I would be inclined just to let it loose on the whole disk rather than break it up into parts.. but then I have heaps of ram too..

Regards,
Brad

Signature · 3 lines
"Human beings, who are almost unique in having the ability
to learn from the experience of others, are also remarkable
for their apparent disinclination to do so." -- Douglas Adams
#3 lore raw
In reply to Jeff Breidenbach
Quoted 9 lines · Jeff Breidenbach

Hi all,

I have a two drive RAID1 serving data for a busy website. The partition is 500GB and contains millions of 10KB files. For reference, here's /proc/mdstat

Personalities : [raid1]
md0 : active raid1 sdc1[0] sdd1[1]

Quoted 7 lines
      488383936 blocks [2/2] [UU]

For backups, I set the md0 partition to readonly and then use dd_rescue
+ netcat to copy the parition over a gigabit network. Unfortuantely, this process takes almost 10 hours. I'm only able to copy about 18MB/s from md0 due to disk contention with the webserver. If I had the full attention of a single disk, I could read at nearly 60MB/s.

Sounds like the wrong solution... how about this:
Get one more drive of the same size, and at backup time add it to the
mirror. After rebuild take it back out of the mirror. Put a remount r/o in there at your discresion. Now you have a valid copy of your data, back that up as you like.

If you want to try something "which used to work" see nbd, export 500GB
from another machine, add the network block device to the mirror, let it sync, break the mirror. Haven't tried since 2.4.19 or so.

The real problem is that you should be able to search the disk faster
than that, identify the modified files, and do incrementals regularly. I have 400GB of 2-5MB files, and it takes minutes, not hours, to scan them. That's PATA not SATA, I suspect there may still be issues there, SATA is not as well explored, certainly not by me!

Quoted 10 lines

So - I'm thinking of the following backup scenario. First, remount /dev/md0 readonly just to be safe. Then mount the two component paritions (sdc1, sdd1) readonly. Tell the webserver to work from one component partition, and tell the backup process to work from the other component partition. Once the backup is complete, point the webserver back at /dev/md0, unmount the component partitions, then switch read-write mode back on.

Am I insane?

I don't like the failure scenarios on that one, personally.

One last thought, the slowness of the disk may result from the extended times to do directory operations which you mention. You don't have all those thousands of files in a single directory, do you? How long does it take to do an unsuccessful "find" from the root? Like "find /base -name spvgZy3G" or other name it's not going to find.

Quoted 15 lines

Everything on this system seems bottlenecked by disk I/O. That includes the rate web pages are served as well as the backup process described above. While I'm always hungry for perforance tips, faster backups are the current focus. For those interested in gory details such as drive types, NCQ settings, kernel version and whatnot, I dumped a copy of dmesg output here: http://www.jab.org/dmesg

Cheers,
Jeff
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
bill davidsen <[email protected]>
  CTO TMR Associates, Inc
Doing interesting things with little computers since 1979
#4 lore raw
In reply to Jeff Breidenbach

Should there be any consideration for the utilization of the gigabit interface that is passing all of this backup traffic, as well as the speed of the drive that is doing all of the writing during this transaction? Is the 18MB/s how fast the data is being copied over the network, or is it some metric within the host system?

Thomas

Quoted 39 lines · Jeff Breidenbach

Hi all,

I have a two drive RAID1 serving data for a busy website. The partition is 500GB and contains millions of 10KB files. For reference, here's /proc/mdstat

Personalities : [raid1]
md0 : active raid1 sdc1[0] sdd1[1]

      488383936 blocks [2/2] [UU]

For backups, I set the md0 partition to readonly and then use dd_rescue
+ netcat to copy the parition over a gigabit network. Unfortuantely, this process takes almost 10 hours. I'm only able to copy about 18MB/s from md0 due to disk contention with the webserver. If I had the full attention of a single disk, I could read at nearly 60MB/s.

So - I'm thinking of the following backup scenario. First, remount /dev/md0 readonly just to be safe. Then mount the two component paritions (sdc1, sdd1) readonly. Tell the webserver to work from one component partition, and tell the backup process to work from the other component partition. Once the backup is complete, point the webserver back at /dev/md0, unmount the component partitions, then switch read-write mode back on.

Am I insane?

Everything on this system seems bottlenecked by disk I/O. That includes the rate web pages are served as well as the backup process described above. While I'm always hungry for perforance tips, faster backups are the current focus. For those interested in gory details such as drive types, NCQ settings, kernel version and whatnot, I dumped a copy of dmesg output here: http://www.jab.org/dmesg

Cheers,
Jeff
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to Jeff Breidenbach
Quoted 2 lines · Jeff Breidenbach

Hi all,

[...]

Quoted 7 lines

So - I'm thinking of the following backup scenario. First, remount /dev/md0 readonly just to be safe. Then mount the two component paritions (sdc1, sdd1) readonly. Tell the webserver to work from one component partition, and tell the backup process to work from the other component partition. Once the backup is complete, point the webserver back at /dev/md0, unmount the component partitions, then switch read-write mode back on.

Isn't this just the sort of scenario LVM snapshots are meant for ? It might not help with the duration aspect, but it will mean your services aren't down/non-redundant for the entire time it takes to backup.

Quoted 6 lines

Everything on this system seems bottlenecked by disk I/O. That includes the rate web pages are served as well as the backup process described above. While I'm always hungry for perforance tips, faster backups are the current focus. For those interested in gory details such as drive types, NCQ settings, kernel version and whatnot, I dumped a copy of dmesg output here: http://www.jab.org/dmesg

I think this might be one of those situations where SCSI really does offer a significant performance advantage, although if you're actually filling up that 500G, it'll be a quite a bit more expensive.

See if you can get hold of a reasonably sized array using SCSI drives and do some comparitive benchmarking.

You might also want to experiment with different filesystems, although that may not be feasible...

CS