From d2df1eb3d93fc6dec83b9d2e466e113e15e12538 Mon Sep 17 00:00:00 2001 From: Michael Hashizume Date: Tue, 27 Aug 2024 15:21:02 -0700 Subject: [PATCH] Clarify soft limit on number of facts Puppet warns when the total number of fact values exceeds a soft limit, as PuppetDB performance can start to degrade as that number grows. However, the language that Puppet currently uses to talk about this limit can be ambiguous. We want to emphasize that the total number of fact values--counting all children of all facts (every value in all arrays, hashes, etc.)--is what is relevant to performance. This commit adds more explicit language about what this number is counting. --- lib/puppet/configurer.rb | 2 +- lib/puppet/defaults.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb index cea6c5c2500..617cd482cdc 100644 --- a/lib/puppet/configurer.rb +++ b/lib/puppet/configurer.rb @@ -132,7 +132,7 @@ def convert_catalog(result, duration, facts, options = {}) end def warn_number_of_facts(size, max_number) - Puppet.warning _("The current total number of facts: %{size} exceeds the number of facts limit: %{max_size}") % { size: size, max_size: max_number } + Puppet.warning _("The current total number of fact values: %{size} exceeds the fact values limit: %{max_size}") % { size: size, max_size: max_number } end def warn_fact_name_length(name, max_length) diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb index 7d41b7749e9..2226451302e 100644 --- a/lib/puppet/defaults.rb +++ b/lib/puppet/defaults.rb @@ -1805,7 +1805,9 @@ def self.initialize_default_settings!(settings) :number_of_facts_soft_limit => { :default => 2048, :type => :integer, - :desc => "The soft limit for the total number of facts.", + :desc => "The soft limit for the total number of fact values. This counts the + child elements of all facts (e.g. all items of an array or a hash), not just top + level facts.", }, :payload_soft_limit => { :default => 16 * 1024 * 1024,