Why does the documentation warn against degraded performance when using the same disk for both the data and the mirrorlog of an LVM mirror?

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise MRG Realtime 2
  • LVM mirroring

Issue

We are planning a setup like this:
* server has access via FC network to 2 Hitachi HDS
* using device-mapper-multipath
* using LV mirror for data synchronization between the two HDS disks

The Logical Volume Manager Administration Guide cautions about performance degradation when using the same disk for both the data and the mirror log. Specifically, it states

The mirror log is created on a separate device from the devices on which any
of the mirror legs are created. It is possible, however, to create the
mirror log on the same device as one of the mirror legs by using the --alloc
anywhere argument of the vgcreate command. This may degrade performance, but
it allows you to create a mirror even if you have only two underlying
devices. 

and also

Just as with a standard mirror log, it is possible to create the redundant
mirror logs on the same device as the mirror legs by using the --alloc
anywhere argument of the vgcreate command. This may degrade performance, but
it allows you to create a redundant mirror log even if you do not have
sufficient underlying devices for each log to be kept on a separate device
than the mirror legs. 

Can you clarify this performance degradation?

Resolution

If you allocate your mirrorlog on the same device as the actually data being mirrored, your writes to an LV will involve both data writes and metadata writes to the same underlying device which will be slower than having data writes and metadata writes go to separate devices. This is not a particularly big concern unless you are designing a setup for a mostly-writes workload whose throughput needs to come close to theoretical limits.

The concerns around the choice of device for the mirrorlog are somewhat similar to those around journalling for ext3/4 file systems (where mke2fs allows using a separate device for journalling).

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments