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

Bug#723566: mdcfg: Set guaranteed resync speed to zero to accelerate install



Package: mdcfg
Severity: wishlist
Tags: d-i patch

Hello,

from benchmarks in bug #722898 it has emerged that blockdev-wipe is approx. 20%
faster when the guaranteed md resync speed [*] is zero, meaning that userspace
I/O will always be scheduled ahead of resync I/O. The default setting enforces
1000kB/s resync I/O before userspace requests are honoured. Although setting
aside 1MB/s for resync doesn't sound like much, this can translate to a loss of
10-20MB/s for userspace requests, presumably due to competition for disk
read/write heads. I assume that changing this setting will also bring speed
gains for the package installation phase, that's why I'm proposing a patch (cf.
attachment) to alter the setting whenever md devices are detected.

Bottom line: The proposed patch gives userspace full I/O priority, but md raid
resync will use whatever I/O bandwith that is not required by userspace.

Cheers,
Thiemo

[*] set via /proc/sys/dev/raid/speed_limit_min



-- System Information:
Debian Release: 7.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'proposed-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
>From 086c51a14dbbc8868461c41820d712b9158994ae Mon Sep 17 00:00:00 2001
From: Thiemo Nagel <thiemo.nagel@gmail.com>
Date: Tue, 17 Sep 2013 14:51:59 +0200
Subject: [PATCH] Set guaranteed resync speed to zero to accelerate install

blockdev-wipe is approx. 20% faster that way (cf. bug #722898)
and I'd expect that there'll be similar improvements in the
package installation phase.
---
 mdcfg.sh |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mdcfg.sh b/mdcfg.sh
index 506e58c..2e3c9f7 100755
--- a/mdcfg.sh
+++ b/mdcfg.sh
@@ -430,6 +430,11 @@ if ! [ -e /proc/mdstat ] || ! [ -d /dev/md ]; then
 		exit 0
 	fi
 
+	# Speed up installation by de-priorizing (not stopping) array resync
+	if [ -w /proc/sys/dev/raid/speed_limit_min ]; then
+		echo 0 > /proc/sys/dev/raid/speed_limit_min
+	fi
+
 	# Try to detect MD devices, and start them
 	# mdadm will fail if /dev/md does not already exist
 	mkdir -p /dev/md
-- 
1.7.10.4


Reply to: