tweek 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/tweek +2 -105
  3. data/lib/tweek/version.rb +1 -1
  4. data/sample.set +100 -0
  5. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc8acd5816827fe451b4f223f31c70be9862dc25
4
- data.tar.gz: 114a4da6ae11f12d5fa23edf7b43419fc0d1a78a
3
+ metadata.gz: bbdc274f7328ea05184d341f5dee88f93cd65c25
4
+ data.tar.gz: f7e7207890f05c03e86a8652270d74ba40fbd593
5
5
  SHA512:
6
- metadata.gz: 6c69ab3d791fad607f25d4c6361387d3d59ac99467b9d79b2f6a94cf02c29541912c2f8af85fa430ad464b94cdf50a52e84d15f6012d35e91a2ea1753422f58d
7
- data.tar.gz: 3b20cc0973d271c4d4a5c06aa4c6d247817cc9cd71d08a22fb8604e97d70dee21508d65b8467f8984c18ca3d643130cc126810fbfdd0215568f726e485845e10
6
+ metadata.gz: b352de37782b1728db1928e5986cd0d506188fd2b867d38770112a82d13478119339af50020c9f8540824d08820182d2b58c3e48946a6b2d0d3cb84475850e98
7
+ data.tar.gz: 565b7e18709429bd70f0a037de8266325aed810c692c268b8bf816c44e3f495aba689b5708ebeae58836312e02edc083f9e7a9c5dc046db4e4a0d66ba9f9530c
data/bin/tweek CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
3
  # A script to check a variety of Linux system settings
4
- # See the sample config after __END__ for a description of these.
4
+ # See doc/sample.file for a description of these.
5
5
  # By Nick Townsend, June 2017
6
6
  #
7
7
  require 'rubygems'
@@ -83,112 +83,9 @@ if kernel_ver.nil?
83
83
  end
84
84
  cs = Tweek::App.new(gflag, true, distro, distro_ver, kernel_ver)
85
85
  if ARGV.empty?
86
- fh = DATA
87
- fh.lineno -= 1
86
+ fh = File.open(File.expand_path('../../sample.set',__FILE__))
88
87
  else
89
88
  fh = ARGF
90
89
  end
91
90
  cs.read_sections(fh)
92
91
  exit cs.results
93
-
94
- __END__
95
- # A documentation-rich sample for the parameter checking script
96
- #
97
- # Comments begin with # and extend to the end of the line
98
- # Block comments are Ruby style =begin and =end
99
- # Conditionals use 'k' for kernel version, 'v' for distro version and 'd' for distro
100
- # Version conditionals use the http://guides.rubygems.org/patterns/#semantic-versioning
101
- # Distro conditionals follow Ruby syntax and you may use string or regex comparisons
102
- #
103
- BLKDEV xvda # list one or more block devices here (filename globs OK)
104
- read_ahead_kb = 1024 # to drive more merged IO
105
- scheduler = noop # less CPU wasted stacking an elevator (for SSDs - still for EBS?)
106
- rq_affinity = 2 # 1 to the CPU group, 2 to the actual CPU
107
- nr_requests = 256
108
-
109
- CLOCKSOURCE # Use cat /sys/devices/system/cl*/cl*/available_clocksource to see what's available
110
- # xen is the default as supported on all instance types
111
- # tsc is hardware supported and is significantly quicker, should be used on all post Sandybridge CPUs
112
- clocksource0 = tsc
113
-
114
- KERNEL # Kernel command line parameters
115
- # true must be present, false must be absent, anything else is a value to be matched
116
- xen_nopvspin = true
117
- maxcpus = 63 # Set the number of physical cores, eliminates the 'B' hyperthreads
118
- # This stops cores idling, eliminating turbo, but decrease latency of core spin-up
119
- # intel_idle.max_cstate=1
120
- numa = off if k>3.9 # won't move memory around between NUMA zones, useful with large working set
121
-
122
- SYSCTL
123
- vm.min_free_kbytes = 838608
124
- vm.zone_reclaim = 1 if k~>4.9.0,d=='Ubuntu'
125
- vm.zone_reclaim_mode = 1 if k~>3.13.0, k<4.9.0
126
-
127
- # These parameters taken from Brendan Gregg's Re:Invent talk 2014
128
- net.core.somaxconn = 1000
129
- net.core.netdev_max_backlog = 5000
130
- net.core.rmem_max = 16777216
131
- net.core.wmem_max = 16777216
132
- net.ipv4.tcp_wmem = 4096 12582912 16777216
133
- net.ipv4.tcp_rmem = 4096 12582912 16777216
134
- net.ipv4.tcp_max_syn_backlog = 8096
135
-
136
- net.ipv4.tcp_slow_start_after_idle = 0
137
-
138
- # When making lots of connections to a server enables reuse of a conn in time-wait status,
139
- # if you run out of slots because of this then packets can get dropped!
140
- #
141
- net.ipv4.tcp_tw_reuse = 1
142
- net.ipv4.ip_local_port_range = 1024 65535
143
- net.ipv4.tcp_abort_on_overflow = 1 # allows a connection that is queued to be reset, not just dropped.
144
- net.ipv4.tcp_fin_timeout = 50 if d=~/Amazon|RedHat/i
145
-
146
- # Smoother page cache flushing: background flush earlier, aggressive later
147
- # Brendan Gregg, Re:Invent 2014
148
- #
149
- vm.dirty_ratio = 80
150
- vm.dirty_background_ratio = 5
151
- vm.dirty_expire_centisecs = 12000
152
-
153
- =begin
154
- # These are all the recommended RedHat TCP settings
155
- # not yet validated, so used as demo of multiline comments
156
- net.ipv4.tcp_syn_retries = 0
157
- net.ipv4.tcp_synack_retries = 0
158
- net.ipv4.tcp_timestamps = 0
159
- =end
160
-
161
- NET eth0 # Define one or more network devices
162
- # Check the IRQ strategy:
163
- # aws: Use first numa node, split RSS from RPS
164
- # RSS allocated across 0-7 (node 0), RPS on first numa node
165
- # pin: Differs depending on number of cores
166
- # 32 Apportion across the single node as follows:
167
- # RPS allocated across cores 10-15 and 18-31
168
- # RSS allocated across 0-7
169
- # 64 Use both NUMA nodes, leave first core free on each node
170
- # RPS allocated across remaining cores on each node
171
- # RSS allocated across 1-4 (node 0) then 17-20 (node 1)
172
- # null: Ignore this adapter
173
- irqs = pin
174
- driver = ena
175
- # Check values in /sys/class/net/<device>/ tree
176
- mtu = 9001
177
- device/driver/module/version = 1.1.3
178
-
179
- EXT4 /dev/xvda1 # Define one or more EXT4 devices or mountpoints (filename globs OK)
180
- # Available parameters are those exposed in /proc/fs/ext4/<device>/options
181
-
182
- barrier=true
183
- stripe=0
184
-
185
- XFS /mnt/xfstest # Define one or more XFS devices or mountpoints (filename globs OK)
186
- # XFS parameters in the form "x.y" where x is log|data|naming|realtime
187
- # and y is a valid name, eg. data.sunit or log.sunit
188
-
189
- data.swidth = 2048
190
- data.sunit = 128
191
- data.bsize = 4096
192
- log.sunit = 1
193
-
194
- # vim: ft=ruby ts=8 sw=2 sts=2 et
data/lib/tweek/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tweek
2
- VERSION = "0.9.5"
2
+ VERSION = "0.9.6"
3
3
  end
data/sample.set ADDED
@@ -0,0 +1,100 @@
1
+ # A documentation-rich sample for the parameter checking script
2
+ #
3
+ # Comments begin with # and extend to the end of the line
4
+ # Block comments are Ruby style =begin and =end
5
+ # Conditionals use 'k' for kernel version, 'v' for distro version and 'd' for distro
6
+ # Version conditionals use the http://guides.rubygems.org/patterns/#semantic-versioning
7
+ # Distro conditionals follow Ruby syntax and you may use string or regex comparisons
8
+ #
9
+ BLKDEV xvda # list one or more block devices here (filename globs OK)
10
+ read_ahead_kb = 1024 # to drive more merged IO
11
+ scheduler = noop # less CPU wasted stacking an elevator (for SSDs - still for EBS?)
12
+ rq_affinity = 2 # 1 to the CPU group, 2 to the actual CPU
13
+ nr_requests = 256
14
+
15
+ CLOCKSOURCE # Use cat /sys/devices/system/cl*/cl*/available_clocksource to see what's available
16
+ # xen is the default as supported on all instance types
17
+ # tsc is hardware supported and is significantly quicker, should be used on all post Sandybridge CPUs
18
+ clocksource0 = tsc
19
+
20
+ KERNEL # Kernel command line parameters
21
+ # true must be present, false must be absent, anything else is a value to be matched
22
+ xen_nopvspin = true
23
+ maxcpus = 63 # Set the number of physical cores, eliminates the 'B' hyperthreads
24
+ # This stops cores idling, eliminating turbo, but decrease latency of core spin-up
25
+ # intel_idle.max_cstate=1
26
+ numa = off if k>3.9 # won't move memory around between NUMA zones, useful with large working set
27
+
28
+ SYSCTL
29
+ vm.min_free_kbytes = 838608
30
+ vm.zone_reclaim = 1 if k~>4.9.0,d=='Ubuntu'
31
+ vm.zone_reclaim_mode = 1 if k~>3.13.0, k<4.9.0
32
+
33
+ # These parameters taken from Brendan Gregg's Re:Invent talk 2014
34
+ net.core.somaxconn = 1000
35
+ net.core.netdev_max_backlog = 5000
36
+ net.core.rmem_max = 16777216
37
+ net.core.wmem_max = 16777216
38
+ net.ipv4.tcp_wmem = 4096 12582912 16777216
39
+ net.ipv4.tcp_rmem = 4096 12582912 16777216
40
+ net.ipv4.tcp_max_syn_backlog = 8096
41
+
42
+ net.ipv4.tcp_slow_start_after_idle = 0
43
+
44
+ # When making lots of connections to a server enables reuse of a conn in time-wait status,
45
+ # if you run out of slots because of this then packets can get dropped!
46
+ #
47
+ net.ipv4.tcp_tw_reuse = 1
48
+ net.ipv4.ip_local_port_range = 1024 65535
49
+ net.ipv4.tcp_abort_on_overflow = 1 # allows a connection that is queued to be reset, not just dropped.
50
+ net.ipv4.tcp_fin_timeout = 50 if d=~/Amazon|RedHat/i
51
+
52
+ # Smoother page cache flushing: background flush earlier, aggressive later
53
+ # Brendan Gregg, Re:Invent 2014
54
+ #
55
+ vm.dirty_ratio = 80
56
+ vm.dirty_background_ratio = 5
57
+ vm.dirty_expire_centisecs = 12000
58
+
59
+ =begin
60
+ # These are all the recommended RedHat TCP settings
61
+ # not yet validated, so used as demo of multiline comments
62
+ net.ipv4.tcp_syn_retries = 0
63
+ net.ipv4.tcp_synack_retries = 0
64
+ net.ipv4.tcp_timestamps = 0
65
+ =end
66
+
67
+ NET eth0 # Define one or more network devices
68
+ # Check the IRQ strategy:
69
+ # aws: Use first numa node, split RSS from RPS
70
+ # RSS allocated across 0-7 (node 0), RPS on first numa node
71
+ # pin: Differs depending on number of cores
72
+ # 32 Apportion across the single node as follows:
73
+ # RPS allocated across cores 10-15 and 18-31
74
+ # RSS allocated across 0-7
75
+ # 64 Use both NUMA nodes, leave first core free on each node
76
+ # RPS allocated across remaining cores on each node
77
+ # RSS allocated across 1-4 (node 0) then 17-20 (node 1)
78
+ # null: Ignore this adapter
79
+ irqs = pin
80
+ driver = ena
81
+ # Check values in /sys/class/net/<device>/ tree
82
+ mtu = 9001
83
+ device/driver/module/version = 1.1.3
84
+
85
+ EXT4 /dev/xvda1 # Define one or more EXT4 devices or mountpoints (filename globs OK)
86
+ # Available parameters are those exposed in /proc/fs/ext4/<device>/options
87
+
88
+ barrier=true
89
+ stripe=0
90
+
91
+ XFS /mnt/xfstest # Define one or more XFS devices or mountpoints (filename globs OK)
92
+ # XFS parameters in the form "x.y" where x is log|data|naming|realtime
93
+ # and y is a valid name, eg. data.sunit or log.sunit
94
+
95
+ data.swidth = 2048
96
+ data.sunit = 128
97
+ data.bsize = 4096
98
+ log.sunit = 1
99
+
100
+ # vim: ft=ruby ts=8 sw=2 sts=2 et
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tweek
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Townsend
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-15 00:00:00.000000000 Z
11
+ date: 2017-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -74,6 +74,7 @@ files:
74
74
  - lib/tweek/app.rb
75
75
  - lib/tweek/section.rb
76
76
  - lib/tweek/version.rb
77
+ - sample.set
77
78
  - tweek.gemspec
78
79
  homepage:
79
80
  licenses: