Fix drbd slow before swact

Slow image to volume conversion performance on AIO-DX before first
swact is caused by DRBD device using small I/O block size (4k)
coupled with qemu-img using O_DIRECT (command line option '-t none')

Block size is determined by backing disk and peer capabilities.
Before peer connection is established DRBD assumes a 'safe' block
size of 4k and because lvm is configured on top this size is
also used by devices created by dev-mapper (volumes, etc.). When
the peer comes up the device stack (lvm, drbd, disk) is already
in use and the 4k limit is not updated.

When peers swap primary/secondary roles then device stacks are
created using negotiated I/O block size limits based on peer's
backing disk capabilities so the 4k 'safe' block size is no
longer used.

'drbdmeta' manual page recommends:

  If you will use the resource before it is connected to its peer for
  the first time DRBD may perform better if you use the
  --peer-max-bio-size option. For DRBD versions of the peer use up to
  these values: <8.3.7 -> 4k, 8.3.8 -> 32k, 8.3.9 -> 128k, 8.4.0 ->
  1M.

Setting --peer-max-bio-size to 128k fixes the performance issue.

Story: 2002866
Task: 22815

Change-Id: If562f6931db23c2ffdfade775f5e5fdf5ebce506
Signed-off-by: Don Penney <don.penney@windriver.com>
Signed-off-by: Jack Ding <jack.ding@windriver.com>
This commit is contained in:
Daniel Badea 2018-06-14 10:04:54 +00:00 committed by Jack Ding
parent d22c40d6b0
commit 763f3ccf0e
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,25 @@
From 2628193e8aef471caab27ada848fa8d7de6d93ec Mon Sep 17 00:00:00 2001
From: Daniel Badea <daniel.badea@windriver.com>
Date: Wed, 13 Jun 2018 14:16:53 +0000
Subject: [PATCH] drbd slow before swact
---
manifests/resource/up.pp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifests/resource/up.pp b/manifests/resource/up.pp
index c3557e1..11cf7ee 100644
--- a/manifests/resource/up.pp
+++ b/manifests/resource/up.pp
@@ -23,7 +23,7 @@ define drbd::resource::up (
# drbd is very tenacious about asking for aproval if there is data on the
# volume already.
exec { "initialize DRBD metadata for ${name}":
- command => "yes yes | drbdadm create-md ${name}",
+ command => "yes yes | drbdadm create-md ${name} -W--peer-max-bio-size=128k",
onlyif => "test -e ${disk}",
unless => "drbdadm dump-md ${name} || (drbdadm cstate ${name} | egrep -q '^(PausedSync|Sync|Connected|WFConnection|StandAlone|Verify)') || (drbdadm show-gi ${name} | grep 'meta-data: need apply-al')",
before => Service['drbd'],
--
1.8.3.1

View File

@ -20,6 +20,7 @@ Patch0005: 0005-Add-PausedSync-states-to-acceptable-cstate.patch
Patch0006: 0006-CGTS-7164-Add-resource-options-cpu-mask-to-affine-drbd-kernel-threads.patch
Patch0007: 0007-Add-disk-by-path-test.patch
Patch0008: 0008-CGTS-7953-support-for-new-drbd-resources.patch
Patch0009: 0009-drbd-slow-before-swact.patch
BuildArch: noarch
@ -51,6 +52,7 @@ find . \( -name spec -o -name ext \) | xargs rm -rf
%patch0006 -p1
%patch0007 -p1
%patch0008 -p1
%patch0009 -p1
%install
rm -rf %{buildroot}