From 8bb2e57c523cc27915b422d077ba5c644bd85f6a Mon Sep 17 00:00:00 2001 From: Jan Vcelak Date: Wed, 11 Jan 2012 12:48:19 +0100 Subject: [PATCH] add virtual-guest profile --- tune-profiles/virtual-guest/ktune.sh | 41 +++++++++++++++++++++ tune-profiles/virtual-guest/ktune.sysconfig | 27 ++++++++++++++ tune-profiles/virtual-guest/sysctl.ktune | 41 +++++++++++++++++++++ tune-profiles/virtual-guest/tuned.conf | 21 +++++++++++ 4 files changed, 130 insertions(+) create mode 100755 tune-profiles/virtual-guest/ktune.sh create mode 100644 tune-profiles/virtual-guest/ktune.sysconfig create mode 100644 tune-profiles/virtual-guest/sysctl.ktune create mode 100644 tune-profiles/virtual-guest/tuned.conf diff --git a/tune-profiles/virtual-guest/ktune.sh b/tune-profiles/virtual-guest/ktune.sh new file mode 100755 index 0000000..7419b92 --- /dev/null +++ b/tune-profiles/virtual-guest/ktune.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +. /etc/tune-profiles/functions + +start() { + set_cpu_governor performance +# set_disk_scheduler_quantum 10 + enable_transparent_hugepages + + # Find non-root and non-boot partitions, disable barriers on them + rootvol=$(df -h / | grep "^/dev" | awk '{print $1}') + bootvol=$(df -h /boot | grep "^/dev" | awk '{print $1}') + volumes=$(df -hl --exclude=tmpfs | grep "^/dev" | awk '{print $1}') + + nobarriervols=$(echo "$volumes" | grep -v $rootvol | grep -v $bootvol) + remount_partitions nobarrier $nobarriervols + + multiply_disk_readahead 4 + + return 0 +} + +stop() { + restore_cpu_governor +# restore_disk_scheduler_quantum + restore_transparent_hugepages + + # Find non-root and non-boot partitions, re-enable barriers + rootvol=$(df -h / | grep "^/dev" | awk '{print $1}') + bootvol=$(df -h /boot | grep "^/dev" | awk '{print $1}') + volumes=$(df -hl --exclude=tmpfs | grep "^/dev" | awk '{print $1}') + + nobarriervols=$(echo "$volumes" | grep -v $rootvol | grep -v $bootvol) + remount_partitions barrier $nobarriervols + + multiply_disk_readahead 0.25 + + return 0 +} + +process $@ diff --git a/tune-profiles/virtual-guest/ktune.sysconfig b/tune-profiles/virtual-guest/ktune.sysconfig new file mode 100644 index 0000000..db7b324 --- /dev/null +++ b/tune-profiles/virtual-guest/ktune.sysconfig @@ -0,0 +1,27 @@ +# ktune service configuration + +# This is the ktune sysctl file. You can comment this out to prevent ktune +# from applying its sysctl settings. +#SYSCTL="/etc/sysctl.ktune" + +# Use *.conf files in the ktune configuration directory /etc/ktune.d. +# Value: yes|no, default: yes +# It is useful if you want to load settings from additional files. Set this to +# no if you to prevent ktune from using these additional files. +USE_KTUNE_D="yes" + +# This is the custom sysctl configuration file. Any settings in this file will +# be applied after the ktune settings, overriding them. Comment this out to +# use only the ktune settings. +SYSCTL_POST="/etc/sysctl.conf" + +# This is the I/O scheduler ktune will use. This will *not* override anything +# explicitly set on the kernel command line, nor will it change the scheduler +# for any block device that is using a non-default scheduler when ktune starts. +# You should probably leave this on "deadline", but "as", "cfq", and "noop" are +# also legal values. Comment this out to prevent ktune from changing I/O +# scheduler settings. +ELEVATOR="deadline" + +# These are the devices, that should be tuned with the ELEVATOR +ELEVATOR_TUNE_DEVS="/sys/block/{sd,cciss,dm-,vd}*/queue/scheduler" diff --git a/tune-profiles/virtual-guest/sysctl.ktune b/tune-profiles/virtual-guest/sysctl.ktune new file mode 100644 index 0000000..d7c2434 --- /dev/null +++ b/tune-profiles/virtual-guest/sysctl.ktune @@ -0,0 +1,41 @@ +# ktune sysctl settings for rhel6 servers with enterprise-class +# storage, maximizing i/o throughput +# +# Minimal preemption granularity for CPU-bound tasks: +# (default: 1 msec# (1 + ilog(ncpus)), units: nanoseconds) +kernel.sched_min_granularity_ns = 10000000 + +# SCHED_OTHER wake-up granularity. +# (default: 1 msec# (1 + ilog(ncpus)), units: nanoseconds) +# +# This option delays the preemption effects of decoupled workloads +# and reduces their over-scheduling. Synchronous workloads will still +# have immediate wakeup/sleep latencies. +kernel.sched_wakeup_granularity_ns = 15000000 + +# Filesystem I/O is usually much more efficient than swapping, so try to keep +# swapping low. It's usually safe to go even lower than this on systems with +# server-grade storage. +vm.swappiness = 30 + +# If a workload mostly uses anonymous memory and it hits this limit, the entire +# working set is buffered for I/O, and any more write buffering would require +# swapping, so it's time to throttle writes until I/O can catch up. Workloads +# that mostly use file mappings may be able to use even higher values. +# +# The generator of dirty data starts writeback at this percentage (system default +# is 20%) +vm.dirty_ratio = 40 + +# Start background writeback (via writeback threads) at this percentage (system +# default is 10%) +#vm.dirty_background_ratio = 15 + +# PID allocation wrap value. When the kernel's next PID value +# reaches this value, it wraps back to a minimum PID value. +# PIDs of value pid_max or larger are not allocated. +# +# A suggested value for pid_max is 1024 * <# of cpu cores/threads in system> +# e.g., a box with 32 cpus, the default of 32768 is reasonable, for 64 cpus, +# 65536, for 4096 cpus, 4194304 (which is the upper limit possible). +#kernel.pid_max = 65536 diff --git a/tune-profiles/virtual-guest/tuned.conf b/tune-profiles/virtual-guest/tuned.conf new file mode 100644 index 0000000..6c574fc --- /dev/null +++ b/tune-profiles/virtual-guest/tuned.conf @@ -0,0 +1,21 @@ +# disable tuned + +[main] + +[DiskMonitor] +enabled=False + +[DiskTuning] +enabled=False + +[NetMonitor] +enabled=False + +[NetTuning] +enabled=False + +[CPUMonitor] +enabled=False + +[CPUTuning] +enabled=False