-
Notifications
You must be signed in to change notification settings - Fork 0
/
tuned-profiles-update-0.2.15.patch
577 lines (554 loc) · 19.2 KB
/
tuned-profiles-update-0.2.15.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
Profiles updates to upstream version 0.2.15.
Generated from following git commits. Some minor changes were necessary,
spindown-disk profiles was excluded.
d88e885 ktune: update throughput-performance profile for rhel6
6982c57 ktune: increase pid_max in throughtput-performance profile
c62252b throughput-performance: removed SYSCTL option
acad0bb tuned-adm: better active profile displaying
4fff679 latency-performance: removed sysctl 'net' bits
e12dc4f tuned-adm: fixed disabling tuned
347a24a throughput-performance: updated save paths
34a8129 tune-profiles: added missing VAR_SUBSYS_KTUNE
1d32fcb latency-performance: enable performance governor
34cd670 laptop-battery-powersave: enable ondemand governor
3be9255 governors: prefer cpuspeed, restore for each CPU
927529c further throughput-performance profile tweaks
-----
diff -ruNP tuned-0.2.11.old/tune-profiles/desktop-powersave/ktune.sh tuned-0.2.11.new/tune-profiles/desktop-powersave/ktune.sh
--- tuned-0.2.11.old/tune-profiles/desktop-powersave/ktune.sh 2010-03-23 11:45:36.000000000 +0100
+++ tuned-0.2.11.new/tune-profiles/desktop-powersave/ktune.sh 2010-07-14 17:32:15.075548540 +0200
@@ -1,5 +1,7 @@
#!/bin/sh
+VAR_SUBSYS_KTUNE="/var/lock/subsys/ktune"
+
ALPM="min_power"
set_alpm() {
diff -ruNP tuned-0.2.11.old/tune-profiles/laptop-ac-powersave/ktune.sh tuned-0.2.11.new/tune-profiles/laptop-ac-powersave/ktune.sh
--- tuned-0.2.11.old/tune-profiles/laptop-ac-powersave/ktune.sh 2010-03-23 11:45:36.000000000 +0100
+++ tuned-0.2.11.new/tune-profiles/laptop-ac-powersave/ktune.sh 2010-07-14 17:32:15.075548540 +0200
@@ -1,5 +1,7 @@
#!/bin/sh
+VAR_SUBSYS_KTUNE="/var/lock/subsys/ktune"
+
ALPM="min_power"
set_alpm() {
diff -ruNP tuned-0.2.11.old/tune-profiles/laptop-battery-powersave/ktune.sh tuned-0.2.11.new/tune-profiles/laptop-battery-powersave/ktune.sh
--- tuned-0.2.11.old/tune-profiles/laptop-battery-powersave/ktune.sh 2010-03-23 11:45:36.000000000 +0100
+++ tuned-0.2.11.new/tune-profiles/laptop-battery-powersave/ktune.sh 2010-07-14 17:32:15.076549293 +0200
@@ -1,5 +1,14 @@
#!/bin/sh
+VAR_SUBSYS_KTUNE="/var/lock/subsys/ktune"
+
+CPUSPEED_SAVE_FILE="/var/run/tuned/ktune-cpuspeed.save"
+CPUSPEED_ORIG_GOV="/var/run/tuned/ktune-cpuspeed-governor-%s.save"
+CPUSPEED_STARTED="/var/run/tuned/ktune-cpuspeed-started"
+CPUSPEED_CFG="/etc/sysconfig/cpuspeed"
+CPUSPEED_INIT="/etc/init.d/cpuspeed"
+CPUS="$(ls -d1 /sys/devices/system/cpu/cpu* | sed 's;^.*/;;' | grep "cpu[0-9]\+")"
+
ALPM="min_power"
set_alpm() {
@@ -25,8 +34,33 @@
# Enables multi core power savings for low wakeup systems
[ -e /sys/devices/system/cpu/sched_mc_power_savings ] && echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
- # Enable ondemand governor (best for powersaving)
- [ -e /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ] && echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ # Enable ondemand CPU governor (prefer cpuspeed)
+ if [ -e $CPUSPEED_INIT ]; then
+ if [ ! -e $CPUSPEED_SAVE_FILE -a -e $CPUSPEED_CFG ]; then
+ cp -p $CPUSPEED_CFG $CPUSPEED_SAVE_FILE
+ sed -e 's/^GOVERNOR=.*/GOVERNOR=ondemand/g' $CPUSPEED_SAVE_FILE > $CPUSPEED_CFG
+ fi
+
+ service cpuspeed status >/dev/null 2>&1
+ [ $? -eq 3 ] && touch $CPUSPEED_STARTED || rm -f $CPUSPEED_STARTED
+
+ service cpuspeed restart >/dev/null 2>&1
+ else
+ echo >/dev/stderr
+ echo "Suggestion: install 'cpuspeed' package to get better powersaving results." >/dev/stderr
+ echo "Falling back to 'ondemand' scaling governor for all CPUs." >/dev/stderr
+ echo >/dev/stderr
+
+ for cpu in $CPUS; do
+ gov_file=/sys/devices/system/cpu/$cpu/cpufreq/scaling_governor
+ save_file=$(printf $CPUSPEED_ORIG_GOV $cpu)
+ rm -f $save_file
+ if [ -e $gov_file ]; then
+ cat $gov_file > $save_file
+ echo ondemand > $gov_file
+ fi
+ done
+ fi
# Enable AC97 audio power saving
[ -e /sys/module/snd_ac97_codec/parameters/power_save ] && echo Y > /sys/module/snd_ac97_codec/parameters/power_save
@@ -37,6 +71,7 @@
# Enable power saving mode for Wi-Fi cards
for i in /sys/bus/pci/devices/*/power_level ; do echo 5 > $i ; done > /dev/null 2>&1
+
return 0
}
@@ -49,8 +84,35 @@
# Disables multi core power savings for low wakeup systems
[ -e /sys/devices/system/cpu/sched_mc_power_savings ] && echo 0 > /sys/devices/system/cpu/sched_mc_power_savings
- # Enable ondemand governor (best for powersaving)
- [ -e /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ] && echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ # Revert previous CPU governor
+ if [ -e $CPUSPEED_INIT ]; then
+ if [ -e $CPUSPEED_SAVE_FILE ]; then
+ cp -fp $CPUSPEED_SAVE_FILE $CPUSPEED_CFG
+ rm -f $CPUSPEED_SAVE_FILE
+ fi
+
+ if [ -e $CPUSPEED_STARTED ]; then
+ rm -f $CPUSPEED_STARTED
+ service cpuspeed stop >/dev/null 2>&1
+ else
+ service cpuspeed restart >/dev/null 2>&1
+ fi
+ else
+ for cpu in $CPUS; do
+ cpufreq_dir=/sys/devices/system/cpu/$cpu/cpufreq
+ save_file=$(printf $CPUSPEED_ORIG_GOV $cpu)
+
+ if [ -e $cpufreq_dir/scaling_governor ]; then
+ if [ -e $save_file ]; then
+ cat $save_file > $cpufreq_dir/scaling_governor
+ rm -f $save_file
+ else
+ echo userspace > $cpufreq_dir/scaling_governor
+ cat $cpufreq_dir/cpuinfo_max_freq > $cpufreq_dir/scaling_setspeed
+ fi
+ fi
+ done
+ fi
# Enable AC97 audio power saving
[ -e /sys/module/snd_ac97_codec/parameters/power_save ] && echo Y > /sys/module/snd_ac97_codec/parameters/power_save
diff -ruNP tuned-0.2.11.old/tune-profiles/latency-performance/ktune.sh tuned-0.2.11.new/tune-profiles/latency-performance/ktune.sh
--- tuned-0.2.11.old/tune-profiles/latency-performance/ktune.sh 1970-01-01 01:00:00.000000000 +0100
+++ tuned-0.2.11.new/tune-profiles/latency-performance/ktune.sh 2010-07-14 17:32:15.076549293 +0200
@@ -0,0 +1,120 @@
+#!/bin/sh
+
+VAR_SUBSYS_KTUNE="/var/lock/subsys/ktune"
+
+CPUSPEED_SAVE_FILE="/var/run/tuned/ktune-cpuspeed.save"
+CPUSPEED_ORIG_GOV="/var/run/tuned/ktune-cpuspeed-governor-%s.save"
+CPUSPEED_STARTED="/var/run/tuned/ktune-cpuspeed-started"
+CPUSPEED_CFG="/etc/sysconfig/cpuspeed"
+CPUSPEED_INIT="/etc/init.d/cpuspeed"
+CPUS="$(ls -d1 /sys/devices/system/cpu/cpu* | sed 's;^.*/;;' | grep "cpu[0-9]\+")"
+
+start() {
+ # Enable performance CPU governor (prefer cpuspeed)
+ if [ -e $CPUSPEED_INIT ]; then
+ if [ ! -e $CPUSPEED_SAVE_FILE -a -e $CPUSPEED_CFG ]; then
+ cp -p $CPUSPEED_CFG $CPUSPEED_SAVE_FILE
+ sed -e 's/^GOVERNOR=.*/GOVERNOR=performance/g' $CPUSPEED_SAVE_FILE > $CPUSPEED_CFG
+ fi
+
+ service cpuspeed status >/dev/null 2>&1
+ [ $? -eq 3 ] && touch $CPUSPEED_STARTED || rm -f $CPUSPEED_STARTED
+
+ service cpuspeed restart >/dev/null 2>&1
+ else
+ echo >/dev/stderr
+ echo "Suggestion: install 'cpuspeed' package to get best performance and latency." >/dev/stderr
+ echo "Falling back to 'performance' scaling governor for all CPUs." >/dev/stderr
+ echo >/dev/stderr
+
+ for cpu in $CPUS; do
+ gov_file=/sys/devices/system/cpu/$cpu/cpufreq/scaling_governor
+ save_file=$(printf $CPUSPEED_ORIG_GOV $cpu)
+ rm -f $save_file
+ if [ -e $gov_file ]; then
+ cat $gov_file > $save_file
+ echo performance > $gov_file
+ fi
+ done
+ fi
+
+ return 0
+}
+
+stop() {
+ # Re-enable previous CPU governor
+ if [ -e $CPUSPEED_INIT ]; then
+ if [ -e $CPUSPEED_SAVE_FILE ]; then
+ cp -fp $CPUSPEED_SAVE_FILE $CPUSPEED_CFG
+ rm -f $CPUSPEED_SAVE_FILE
+ fi
+
+ if [ -e $CPUSPEED_STARTED ]; then
+ rm -f $CPUSPEED_STARTED
+ service cpuspeed stop >/dev/null 2>&1
+ else
+ service cpuspeed restart >/dev/null 2>&1
+ fi
+ else
+ for cpu in $CPUS; do
+ cpufreq_dir=/sys/devices/system/cpu/$cpu/cpufreq
+ save_file=$(printf $CPUSPEED_ORIG_GOV $cpu)
+
+ if [ -e $cpufreq_dir/scaling_governor ]; then
+ if [ -e $save_file ]; then
+ cat $save_file > $cpufreq_dir/scaling_governor
+ rm -f $save_file
+ else
+ echo userspace > $cpufreq_dir/scaling_governor
+ cat $cpufreq_dir/cpuinfo_max_freq > $cpufreq_dir/scaling_setspeed
+ fi
+ fi
+ done
+ fi
+
+ return 0
+}
+
+reload() {
+ start
+}
+
+status() {
+ return 0
+}
+
+case "$1" in
+ start)
+ [ -f "$VAR_SUBSYS_KTUNE" ] && exit 0
+ start
+ RETVAL=$?
+ ;;
+ stop)
+ [ -f "$VAR_SUBSYS_KTUNE" ] || exit 0
+ stop
+ RETVAL=$?
+ ;;
+ reload)
+ [ -f "$VAR_SUBSYS_KTUNE" ] && reload
+ RETVAL=$?
+ ;;
+ restart|force-reload)
+ [ -f "$VAR_SUBSYS_KTUNE" ] && stop
+ start
+ RETVAL=$?
+ ;;
+ condrestart|try-restart)
+ [ -f "$VAR_SUBSYS_KTUNE" ] || exit 0
+ stop
+ start
+ RETVAL=$?
+ ;;
+ status)
+ status
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|condrestart|status}"
+ RETVAL=2
+ ;;
+esac
diff -ruNP tuned-0.2.11.old/tune-profiles/latency-performance/sysctl.ktune tuned-0.2.11.new/tune-profiles/latency-performance/sysctl.ktune
--- tuned-0.2.11.old/tune-profiles/latency-performance/sysctl.ktune 2010-03-23 11:45:36.000000000 +0100
+++ tuned-0.2.11.new/tune-profiles/latency-performance/sysctl.ktune 2010-07-14 17:32:15.077548858 +0200
@@ -1,7 +1 @@
-# ktune sysctl settings for latency tuning
-net.ipv4.conf.default.arp_filter=1
-net.ipv4.tcp_low_latency=1
-net.ipv4.tcp_window_scaling=0
-net.ipv4.tcp_rmem = 4096 87380 4194304
-net.ipv4.tcp_wmem = 4096 16384 4194304
-net.ipv4.tcp_mem = 196608 262144 393216
+# ktune sysctl
diff -ruNP tuned-0.2.11.old/tune-profiles/server-powersave/ktune.sh tuned-0.2.11.new/tune-profiles/server-powersave/ktune.sh
--- tuned-0.2.11.old/tune-profiles/server-powersave/ktune.sh 2010-03-23 11:45:36.000000000 +0100
+++ tuned-0.2.11.new/tune-profiles/server-powersave/ktune.sh 2010-07-14 17:32:15.077548858 +0200
@@ -1,5 +1,7 @@
#!/bin/sh
+VAR_SUBSYS_KTUNE="/var/lock/subsys/ktune"
+
ALPM="min_power"
set_alpm() {
diff -ruNP tuned-0.2.11.old/tune-profiles/throughput-performance/ktune.sh tuned-0.2.11.new/tune-profiles/throughput-performance/ktune.sh
--- tuned-0.2.11.old/tune-profiles/throughput-performance/ktune.sh 1970-01-01 01:00:00.000000000 +0100
+++ tuned-0.2.11.new/tune-profiles/throughput-performance/ktune.sh 2010-07-14 17:32:32.320549738 +0200
@@ -0,0 +1,133 @@
+#!/bin/sh
+
+VAR_SUBSYS_KTUNE="/var/lock/subsys/ktune"
+
+CPUSPEED_SAVE_FILE="/var/run/tuned/ktune-cpuspeed.save"
+CPUSPEED_ORIG_GOV="/var/run/tuned/ktune-cpuspeed-governor-%s.save"
+CPUSPEED_STARTED="/var/run/tuned/ktune-cpuspeed-started"
+CPUSPEED_CFG="/etc/sysconfig/cpuspeed"
+CPUSPEED_INIT="/etc/init.d/cpuspeed"
+CPUS="$(ls -d1 /sys/devices/system/cpu/cpu* | sed 's;^.*/;;' | grep "cpu[0-9]\+")"
+
+THP_ENABLE="/sys/kernel/mm/redhat_transparent_hugepage/enabled"
+THP_SAVE="/var/run/tuned/ktune-thp.save"
+
+start() {
+ # Enable performance CPU governor (prefer cpuspeed)
+ if [ -e $CPUSPEED_INIT ]; then
+ if [ ! -e $CPUSPEED_SAVE_FILE -a -e $CPUSPEED_CFG ]; then
+ cp -p $CPUSPEED_CFG $CPUSPEED_SAVE_FILE
+ sed -e 's/^GOVERNOR=.*/GOVERNOR=performance/g' $CPUSPEED_SAVE_FILE > $CPUSPEED_CFG
+ fi
+
+ service cpuspeed status >/dev/null 2>&1
+ [ $? -eq 3 ] && touch $CPUSPEED_STARTED || rm -f $CPUSPEED_STARTED
+
+ service cpuspeed restart >/dev/null 2>&1
+ else
+ echo >/dev/stderr
+ echo "Suggestion: install 'cpuspeed' package to get best performance and latency." >/dev/stderr
+ echo "Falling back to 'performance' scaling governor for all CPUs." >/dev/stderr
+ echo >/dev/stderr
+
+ for cpu in $CPUS; do
+ gov_file=/sys/devices/system/cpu/$cpu/cpufreq/scaling_governor
+ save_file=$(printf $CPUSPEED_ORIG_GOV $cpu)
+ rm -f $save_file
+ if [ -e $gov_file ]; then
+ cat $gov_file > $save_file
+ echo performance > $gov_file
+ fi
+ done
+ fi
+
+ # Make sure transparent hugepages are enabled
+ cut -f2 -d'[' $THP_ENABLE | cut -f1 -d']' > $THP_SAVE
+ (echo always > $THP_ENABLE) > /dev/null 2>&1
+
+ return 0
+}
+
+stop() {
+ # Re-enable previous CPU governor
+ if [ -e $CPUSPEED_INIT ]; then
+ if [ -e $CPUSPEED_SAVE_FILE ]; then
+ cp -fp $CPUSPEED_SAVE_FILE $CPUSPEED_CFG
+ rm -f $CPUSPEED_SAVE_FILE
+ fi
+
+ if [ -e $CPUSPEED_STARTED ]; then
+ rm -f $CPUSPEED_STARTED
+ service cpuspeed stop >/dev/null 2>&1
+ else
+ service cpuspeed restart >/dev/null 2>&1
+ fi
+ else
+ for cpu in $CPUS; do
+ cpufreq_dir=/sys/devices/system/cpu/$cpu/cpufreq
+ save_file=$(printf $CPUSPEED_ORIG_GOV $cpu)
+
+ if [ -e $cpufreq_dir/scaling_governor ]; then
+ if [ -e $save_file ]; then
+ cat $save_file > $cpufreq_dir/scaling_governor
+ rm -f $save_file
+ else
+ echo userspace > $cpufreq_dir/scaling_governor
+ cat $cpufreq_dir/cpuinfo_max_freq > $cpufreq_dir/scaling_setspeed
+ fi
+ fi
+ done
+ fi
+
+ # Restore transparent hugepages setting
+ if [ -e $THP_SAVE ]; then
+ (echo $(cat $THP_SAVE) > $THP_ENABLE) > /dev/null 2>&1
+ rm -f $THP_SAVE
+ fi
+
+ return 0
+}
+
+reload() {
+ start
+}
+
+status() {
+ return 0
+}
+
+case "$1" in
+ start)
+ [ -f "$VAR_SUBSYS_KTUNE" ] && exit 0
+ start
+ RETVAL=$?
+ ;;
+ stop)
+ [ -f "$VAR_SUBSYS_KTUNE" ] || exit 0
+ stop
+ RETVAL=$?
+ ;;
+ reload)
+ [ -f "$VAR_SUBSYS_KTUNE" ] && reload
+ RETVAL=$?
+ ;;
+ restart|force-reload)
+ [ -f "$VAR_SUBSYS_KTUNE" ] && stop
+ start
+ RETVAL=$?
+ ;;
+ condrestart|try-restart)
+ [ -f "$VAR_SUBSYS_KTUNE" ] || exit 0
+ stop
+ start
+ RETVAL=$?
+ ;;
+ status)
+ status
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|condrestart|status}"
+ RETVAL=2
+ ;;
+esac
diff -ruNP tuned-0.2.11.old/tune-profiles/throughput-performance/sysctl.ktune tuned-0.2.11.new/tune-profiles/throughput-performance/sysctl.ktune
--- tuned-0.2.11.old/tune-profiles/throughput-performance/sysctl.ktune 2010-03-23 11:45:36.000000000 +0100
+++ tuned-0.2.11.new/tune-profiles/throughput-performance/sysctl.ktune 2010-07-14 17:32:33.728548320 +0200
@@ -1,51 +1,35 @@
-# ktune sysctl settings for EL 5 servers
-
-# 256 KB default performs well experimentally, and is often recommended by ISVs.
-net.core.rmem_default = 262144
-net.core.wmem_default = 262144
-
-# When opening a high-bandwidth connection while the receiving end is under
-# memory pressure, disk I/O may be necessary to free memory for the socket,
-# making disk latency the effective latency for the bandwidth-delay product
-# initially. For 10 Gb ethernet and SCSI, the BDP is about 5 MB. Allow 8 MB
-# to account for overhead, to ensure that new sockets can saturate the medium
-# quickly.
-net.core.rmem_max = 8388608
-net.core.wmem_max = 8388608
-
-# Allow a deep backlog for 10 Gb and bonded Gb ethernet connections
-net.core.netdev_max_backlog = 10000
-
-# Always have one page available, plus an extra for overhead, to ensure TCP NFS
-# pageout doesn't stall under memory pressure. Default to max unscaled window,
-# plus overhead for rmem, since most LAN sockets won't need to scale.
-net.ipv4.tcp_rmem = 8192 87380 8388608
-net.ipv4.tcp_wmem = 8192 65536 8388608
-
-# Always have enough memory available on a UDP socket for an 8k NFS request,
-# plus overhead, to prevent NFS stalling under memory pressure. 16k is still
-# low enough that memory fragmentation is unlikely to cause problems.
-net.ipv4.udp_rmem_min = 16384
-net.ipv4.udp_wmem_min = 16384
-
-# Ensure there's enough memory to actually allocate those massive buffers to a
-# socket.
-net.ipv4.tcp_mem = 8388608 12582912 16777216
-net.ipv4.udp_mem = 8388608 12582912 16777216
-
-# 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
+# ktune sysctl settings for rhel6 servers, 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
# 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.
-vm.dirty_ratio = 50
-
-# Ensure there's always some easily-dropped pagecache if the system is under
-# memory pressure from cached files, since it's much faster to page back in than
-# swap.
-# Doesn't exist for 2.6.30++ anymore
-# vm.pagecache = 90
+#
+# 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 -ruNP tuned-0.2.11.old/tuned_adm.py tuned-0.2.11.new/tuned_adm.py
--- tuned-0.2.11.old/tuned_adm.py 2010-07-14 17:31:46.087674798 +0200
+++ tuned-0.2.11.new/tuned_adm.py 2010-07-14 17:32:15.078548772 +0200
@@ -39,7 +39,7 @@
if args[0] == "list":
self.list()
elif args[0] == "active":
- print self.get_active()
+ self.active()
elif args[0] == "off":
self.check_permissions()
self.off()
@@ -53,22 +53,22 @@
self.error("Nonexistent argument '%s'." % args[0])
def list(self):
- active = self.get_active()
modes = os.listdir(self.profile_dir)
if len(modes) > 0:
- print "Available profiles: "
+ print "Available profiles:"
for mode in modes:
dir = os.path.join(self.profile_dir, mode)
if not os.path.isdir(dir):
continue
+ print "- %s" % mode
- if mode == active:
- print "- %s (active)" % mode
- else:
- print "- %s" % mode
+ self.active()
else:
print "No profiles defined."
+ def active(self):
+ print "Current active profile: %s" % self.get_active()
+
def get_active(self):
file = open(self.active_file, "r")
profile = file.read()
@@ -103,6 +103,12 @@
def off(self):
self.set_active("off")
+ # disable services
+ os.system('service ktune stop')
+ os.system('service tuned stop')
+ os.system('chkconfig --del ktune')
+ os.system('chkconfig --del tuned')
+
# remove profile settings
self.remove("/etc/ktune.d/*.conf", os.path.islink)
self.remove("/etc/ktune.d/*.sh", os.path.islink)
@@ -113,12 +119,6 @@
if os.path.exists("/etc/tuned.conf.bckp") and os.path.exists("/etc/tuned.conf"):
os.rename("/etc/tuned.conf.bckp", "/etc/tuned.conf")
- # disable services
- os.system('service ktune stop')
- os.system('service tuned stop')
- os.system('chkconfig --del ktune')
- os.system('chkconfig --del tuned')
-
def profile(self, profile):
enablektune = False
enabletuned = False