In Puppet Enterprise (PE) 2021.4 or later, you get a warning about having too many facts, too many top-level facts, or having a fact name or value with a length that’s too long.
Error messages
Warning: The current total number of facts: 2055 exceeds the number of facts limit: 2048
In PE 2021.4, warning messages were added to increase awareness that the length of fact names, values and number of facts, and top-level facts affect performance. Each of the following settings has a default limit. If a limit is exceeded on any node, you get a warning message:
-
fact_name_length_soft_limit
, default value 2560 bytes: The soft limit for the length of a fact name. -
fact_value_length_soft_limit
, default value 4096 bytes: The soft limit for the length of a fact value. -
top_level_facts_soft_limit
, default value 512: The soft limit for the number of top-level facts. -
number_of_facts_soft_limit
, default value 2048: The soft limit for the total number of facts.
Version and installation information
PE version: 2021.4 and later
Solution
If your fact set isn’t causing performance issues, you can increase the soft limits for these settings in affected nodes’ puppet.conf
files. To do that, you can either use the puppetlabs-inifile
module’s ini_setting
resources to use Puppet to manage the settings or you can use the puppetlabs-puppet_conf
module’s puppet_conf
task to set it with a single ad-hoc action.
Use the puppetlabs-inifile
module’s ini_setting
resources
-
Use the instructions in the
puppetlabs-inifile
README to set up the module. -
For example, to manage the
number_of_facts_soft_limit
setting, add the followingini_setting
resource to a class:$conf_dir = $facts['os']['family'] ? { 'windows' => "${facts['common_appdata']}/PuppetLabs/puppet/etc", default => '/etc/puppetlabs/puppet' } ini_setting { 'puppet agent: number_of_facts_soft_limit': ensure => present, path => "${conf_dir}/puppet.conf", section => 'agent', setting => 'number_of_facts_soft_limit', value => '2060' }
After you make the change, you won’t get the warning message again. You can also set the soft limit to 0
to stop warnings. However, since the messages are intended to keep you from having performance problems, we recommend keeping them in place.
Use the puppetlabs-puppet_conf
module’s puppet_conf
task
To make changes to limit setting(s) with a PE task, you can use the puppetlabs-puppet_conf
module’s puppet_conf
task. The module is installed with PE, so you don’t need to install it separately.
Learn more about using tasks from our documentation.
After you make the change, you won’t get the warning message again. You can also set the soft limit to 0
to stop warnings. However, since the messages are intended to keep you from having performance problems, we recommend keeping them in place.
Learn more about the settings to check fact limits in our documentation.
How can we improve this article?
0 comments
Please sign in to leave a comment.
Related articles