Professional Documents
Culture Documents
Joe Mario
Senior Principal Software Engineer
Sept 22, 2016
C6 C3 C1 C0
250
Latency (Microseconds)
200
150
100
50
0
Max
3500
3000
2500
2000
1500
1000
500
0
ext3 ext4 xfs gfs2
not tuned tuned
Larger is
better
13 RED HAT CONFIDENTIAL
#rhconvergence
throughput-performance (RHEL7 default)
• governor=performance
• energy_perf_bias=performance
• min_perf_pct=100
• readahead=4096
• kernel.sched_min_granularity_ns = 10000000
• kernel.sched_wakeup_granularity_ns = 15000000
• vm.dirty_background_ratio = 10
• vm.swappiness=10
throughput-performance
governor=performance
energy_perf_bias=performance
min_perf_pct=100
readahead=4096
kernel.sched_min_granularity_ns = 10000000
kernel.sched_wakeup_granularity_ns = 15000000
vm.dirty_background_ratio = 10
vm.swappiness=10
network-throughput
Parents
throughput-performance balanced latency-performance
Children
network-throughput desktop network-latency
virtual-host
virtual-guest
Node 0 Node 1
Node 0 RAM Node 1 RAM
Node 2 Node 3
Node 2 RAM Node 3 RAM
Process 37
https://access.redhat.com/site/solutions/62879
● RHEL6
● numactl, numastat enhancements
● numad – usermode tool, dynamically monitor, auto-tune
● RHEL7 – auto numa balancing
● Moves tasks (threads or processes) closer to the memory
they are accessing.
● Moves application data to memory closer to the tasks that
reference it.
● A win for most apps.
● Enable / Disable
● sysctl kernel.numabalancing={0,1}
3000000
RHEL7 – No_NUMA
2500000 Auto-Numa-Balance – BM
Auto-Numa-Balance - KVM
2000000
bops
1500000
1000000
500000
0
1 instance 2 intsance 4 instance 8 instance
1600
30
1400
25
Elapsed Seconds
1200 AutoNuma On
1000 20 AutoNuma Off
% Difference
800 15
600
10
400
5
200
0 0
10 20 30 40 50 60 70 80 90 100 110 120 130 140 150
Number of Users
1, 2 and 4 instances with and without Autonuma for 100 User set
0
-2
-4
-6
% Difference
Trans / Min
-8
-10
-12
-14
-16
1 Instance 2 Instances 4 Instances
Num of Instances
● With hugepages, there is no performance difference with Autonuma on or off because the memory is wired
down
● # echo 0 > /proc/sys/kernel/numa_balancing
OLTP Database
9
0
10 User 80 User
Divider
BackupSlide
• busy_poll
●
Polling vs interrupts – big win
•
• tcp_fastopen
●
Reduce 1 round trip of handshake setting up TCP connection.
CPU
• Support for all new CPUs
• AVX2 instruction support
• RHEL-RT – sync w/RHEL 7.x releases.
Power Management
• intel_pstate
• tuned does most heavy lifting
dm-2 16.00 2462.00 344.00 986.20 8.68 46.58 85.08 3.72 2.80 9.38 0.51 0.71 94.86
dm-4 19.20 2468.20 366.60 989.60 9.42 46.58 84.58 3.95 2.92 9.42 0.51 0.72 97.60
dm-15 18.20 2461.20 367.40 989.60 9.26 46.58 84.27 3.80 2.81 8.82 0.57 0.72 98.10
dm-2 17.00 2349.80 320.80 909.60 8.15 45.08 88.60 3.31 2.69 8.55 0.62 0.79 96.86
dm-4 15.40 2333.60 327.00 911.00 8.29 45.08 88.29 3.44 2.79 8.90 0.59 0.78 97.16
dm-15 17.80 2351.20 331.60 913.00 8.49 45.08 88.15 3.32 2.67 8.29 0.63 0.76 94.86
dm-2 2.80 1795.40 339.80 812.80 8.25 35.16 77.14 3.05 2.65 7.69 0.54 0.83 95.40
dm-4 4.40 1819.80 349.20 828.00 8.53 35.16 76.02 3.15 2.68 7.77 0.53 0.81 95.30
dm-15 3.60 1853.00 351.60 834.00 8.53 35.17 75.49 3.08 2.60 7.51 0.53 0.80 94.52
fioa 0.00 0.00 353.80 1715.40 8.51 35.15 43.21 0.01 0.08 0.17 0.07 0.00 0.18
dm-2 2.60 1775.00 325.80 797.80 7.57 34.55 76.76 2.91 2.59 7.58 0.55 0.85 95.02
dm-4 3.00 1786.40 317.20 814.40 7.57 34.55 76.24 2.79 2.46 7.38 0.55 0.83 94.08
dm-15 3.00 1809.60 311.40 814.00 7.75 34.57 77.01 2.76 2.46 7.42 0.56 0.85 95.24
fioa 0.00 0.00 299.40 1676.40 7.57 34.55 43.66 0.00 0.08 0.18 0.06 0.00 0.00
LVM - SSDs
fioa 0.00 0.00 332.60 7110.80 8.87 79.43 24.30 0.12 0.06 0.20 0.05 0.02 11.54
fiob 0.00 0.00 319.40 7060.40 8.59 79.39 24.42 0.79 0.08 0.28 0.07 0.03 24.48
fioa 0.00 0.00 313.00 7083.80 7.72 78.31 23.82 0.01 0.06 0.22 0.06 0.00 0.36
fiob 0.00 0.00 299.80 7109.60 7.83 78.33 23.81 0.23 0.08 0.27 0.07 0.02 11.32
fioa 0.00 0.00 306.00 7049.80 8.06 79.19 24.29 0.00 0.06 0.22 0.06 0.00 0.22
fiob 0.00 0.00 291.60 7060.00 7.88 79.19 24.26 0.98 0.08 0.28 0.07 0.07 49.28
I/O Tuning – Database Layout
1510690
955661
873173
Divider
BackupSlide
1400
1200
1000
MB/sec
800
600
400
200
User Set
● Power management
Divider
BackupSlide
•
C-state: CPU Idle State
•
New Default Idle Driver in RHEL7: intel_pstate
•
Replaces acpi-cpufreq driver
•
CPU governors replaced with sysfs {min,max}_perf_pct
•
Moves Turbo knob into OS control (yay!)
Tuned handles
most of this for you
Divider
BackupSlide
Memory Node 0
Memory Node 1
Memory Node 0
CPU7
CPU4 CPU5 CPU6
x=foo
Life is good.
=================================================================================
Cache CPU
# Refs Stores Data Address Pid Tid Inst Address Symbol Object Participants
=================================================================================
0 118789 273709 0x602380 37878
17734 136078 0x602380 37878 37878 0x401520 read_wrt_thread a.out 0{0};
13452 137631 0x602388 37878 37883 0x4015a0 read_wrt_thread a.out 0{1};
15134 0 0x6023a8 37878 37882 0x4011d7 reader_thread a.out 1{5};
14684 0 0x6023b0 37878 37880 0x4011d7 reader_thread a.out 1{6};
13864 0 0x6023b8 37878 37881 0x4011d7 reader_thread a.out 1{7};
1 31 69 0xff88023960df40 37878
13 69 0xff88023960df70 37878 *** 0xffff8109f8e5 update_cfs_rq_blocked vmlinux 0{0,1,2}; 1{9,16};
17 0 0xff88023960df60 37878 *** 0xffff8109fc2e __update_entity_load_avg vmlinux 0{1,2}; 1{11,16};
1 0 0xff88023960df78 37878 37882 0xffff8109fc4e __update_entity_load_avg vmlinux 0{2};
1 2
• Available in RHEL 7
• Socket-layer code polls receive queue of NIC
• Significant performance improvement
• Avoids interrupts and resulting context switching.
• and NAPI interrupt mitigation
• Retains full capabilities of kernel network stack
Higher is better
Higher is better
https://access.redhat.com/articles/1323793
Tick No No No
Tick
No Ticks
● NFV/Realtime Performance
Divider
BackupSlide