Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yum_updates fact: too slow #280

Open
otheus opened this issue Oct 7, 2022 · 1 comment
Open

yum_updates fact: too slow #280

otheus opened this issue Oct 7, 2022 · 1 comment

Comments

@otheus
Copy link

otheus commented Oct 7, 2022

The yum_updates and yum_has_updates facts are too slow. On a reasonably fast system, 4 to 6s are needed to resolve this fact. Just because we want a yum module to manage packages and repositories, we don't want to drag in a pointless fact when it incurs such a (relatively) high time- and resource cost.

Thus, this shouldn't be a fact unless it can be done with little cost.

However, I'm against deprecating existing features when security is not the primary issue.

Instead, the algorithm can be improved by caching the result.

@otheus
Copy link
Author

otheus commented Oct 7, 2022

It's underdocumented, and not well implemented, but these can be cached by puppet 3.14.10 and higher by modifying $PUPPET_CONFIG_DIR/facter/facter.conf:

facts : {
  ttls : [
    { "cached-custom-facts" : 1 day },
  ]
}
fact-groups :  {
 cached-custom-facts : [
    "yum_has_updates", "yum_updates", "yum_package_updates",
 ]
}

I also recommend package_provider, rsyslog_version since these are relatively slow as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant