Skip to content

Commit 1f08ad5

Browse files
authored
Merge pull request #161 from MartyEwings/sup-3665
(SUP-3665) add check for ineffeicent heap max values
2 parents 95b582c + 16f2733 commit 1f08ad5

File tree

4 files changed

+45
-3
lines changed

4 files changed

+45
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ Refer below for next steps when any indicator reports a `false`.
252252
| S0023 | Determines if certificate authority CRL expires in the next 90 days. | The solution is to reissue a new CRL from the Puppet CA, note this will also remove any revoked certificates. To do this follow the instructions in [this module](https://forge.puppet.com/modules/m0dular/crl_truncate) | Open a Support ticket referencing S0023 and provide [support script](https://puppet.com/docs/pe/latest/getting_support_for_pe.html#pe_support_script) output from the primary server, and errors or output collected from the resolution steps |
253253
| S0024 | Determines if there are files in the puppetdb discard directory newer than 1 week old | Recent files indicate an issue that causes PuppetDB to reject incoming data. Investigate Puppetdb logs at the time the data was rejected to find a cause, | If you are unable to determine a reason for the rejections from logging, Open a Support ticket referencing S0024 and provide a copy of the PuppetDB log for the time in question, along with a sample of the most recent file in the following directory `/opt/puppetlabs/server/data/puppetdb/stockpile/discard/`|
254254
| S0025 | Determines if the host copy of the CRL expires in the next 90 days. | If the Output of S0023 on the primary server is also false use the resolution steps in S0023. If S0023 on the Primary is True, follow [this article](https://support.puppet.com/hc/en-us/articles/7631166251415) | Open a Support ticket referencing S0025 and provide any errors you received in following the resolution steps | |
255+
| S0026 | Determines if pe-puppetserver JVM Heap-Memory is set to an inefficient value. | Due to an odditity in how JVM memory is utilised, most applications are unable to consume heap memory between ~31GB and ~48GB as such is if you have heap memory set within this value, you should reduce it to more efficiently allocate server resources. To set heap refer to [Increase the Java heap size for this service.](https://support.puppet.com/hc/en-us/articles/360015511413) | |
256+
| S0027 | Determines if if pe-puppetdb JVM Heap-Memory is set to an inefficient value. | Due to an odditity in how JVM memory is utilised, most applications are unable to consume heap memory between ~31GB and ~48GB as such is if you have heap memory set within this value, you should reduce it to more efficiently allocate server resources. To set heap refer to [Increase the Java heap size for this service.](https://support.puppet.com/hc/en-us/articles/360015511413) | |
255257
| S0029 | Determines if number of current connections to Postgresql DB is approaching 90% of the `max_connections` defined. | First determine the need to increase connections, evaluate if this message appears on every puppet run, or if idle connections from recent component restarts may be to blame. If persistent, impact is minimal unless you need to add more components such as Compilers or Replicas, if you plan to increase the number of components on your system, increase max_connections value. To increase the maximum number of connections in postgres, adjust `puppet_enterprise::profile::database::max_connections`. Consider also increasing `shared_buffers` if that is the case as each connection consumes RAM. | Should you be unable to determine the reason for a recent increase in connection use, or are having issue upping the number of connections available, open a Support ticket referencing S0029 and provide the current and future value for `puppet_enterprise::profile::database::max_connections` and we will assist.
256258
| S0030 | Determines when infrastructure components have the setting `use_cached_catalog` set to true. | Don't configure use_cached_catalog on PE infrastructure nodes. It prevents the management of key infrastructure settings. Disable this setting on all infrastructure components. [See our documentation for more information](https://puppet.com/docs/puppet/latest/configuration.html#use-cached-catalog) | If you encounter errors after disabling use_cached_catalog, open a Support ticket referencing S0030 and provide the errors.
257259
| S0031 | Determines if old PE agent packages exist on the primary server. | [Remove the old PE agent packages.](https://support.puppet.com/hc/en-us/articles/4405333422103) |

data/static.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ pe_status_check::S0022: "S0022 Determines if there is a valid Puppet Enterprise
2525
pe_status_check::S0023: "S0023 Determines if the CA CRL expires within 90 days"
2626
pe_status_check::S0024: "S0024 Determines if there are files in the puppetdb discard directory newer than 1 week old"
2727
pe_status_check::S0025: "S0025 Determines if the host copy of the CRL expires within 90 days"
28-
pe_status_check::S0026: "S0026 Determines"
29-
pe_status_check::S0027: "S0027 Determines"
28+
pe_status_check::S0026: "S0026 Determines if the Puppet Server JVM Heap-Max is set to an inefficient volume"
29+
pe_status_check::S0027: "S0027 Determines if the Puppetdb JVM Heap-Max is set to an inefficiient volume"
3030
pe_status_check::S0028: "S0028 Determines"
3131
pe_status_check::S0029: "S0029 Determines if number of current connections to Postgresql DB is approaching 90% of the max_connections defined."
3232
pe_status_check::S0030: "S0030 Determines when infrastructure components that run with the setting use_cached_catalog are set to true"

lib/facter/pe_status_check.rb

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,46 @@
292292
{ S0025: (x509_cert.next_update - Time.now) > 7_776_000 }
293293
end
294294

295+
chunk(:S0026) do
296+
next unless ['primary', 'legacy_primary', 'replica', 'pe_compiler', 'legacy_compiler'].include?(Facter.value('pe_status_check_role'))
297+
298+
response = PEStatusCheck.http_get('/status/v1/services?level=debug', 8140)
299+
if response
300+
heap_max = response.dig('status-service', 'status', 'experimental', 'jvm-metrics', 'heap-memory', 'init')
301+
{
302+
S0026: if heap_max.nil?
303+
false
304+
elsif heap_max.is_a?(String)
305+
false
306+
else
307+
(heap_max > 33_285_996_544) && (heap_max < 51_539_607_552) ? false : true
308+
end
309+
}
310+
else
311+
{ S0026: false }
312+
end
313+
end
314+
315+
chunk(:S0027) do
316+
next unless ['primary', 'legacy_primary', 'replica', 'pe_compiler'].include?(Facter.value('pe_status_check_role'))
317+
318+
response = PEStatusCheck.http_get('/status/v1/services?level=debug', 8081)
319+
if response
320+
heap_max = response.dig('status-service', 'status', 'experimental', 'jvm-metrics', 'heap-memory', 'init')
321+
{
322+
S0027: if heap_max.nil?
323+
false
324+
elsif heap_max.is_a?(String)
325+
false
326+
else
327+
(heap_max > 33_285_996_544) && (heap_max < 51_539_607_552) ? false : true
328+
end
329+
}
330+
else
331+
{ S0027: false }
332+
end
333+
end
334+
295335
chunk(:S0029) do
296336
next unless ['primary', 'replica', 'postgres'].include?(Facter.value('pe_status_check_role'))
297337
# check if concurrnet connections to Postgres approaching 90% defined

spec/acceptance/pe_status_check_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Test Confirms all facts are false which is another indicator the class is performing correctly
1717
describe 'check no pe_status_check fact is false' do
1818
it 'if idempotent all facts should be true' do
19-
expect(host_inventory['facter']['pe_status_check'].size).to eq(35)
19+
expect(host_inventory['facter']['pe_status_check'].size).to eq(37)
2020
expect(host_inventory['facter']['pe_status_check'].filter { |_k, v| !v }).to be_empty
2121
end
2222
end

0 commit comments

Comments
 (0)