Skip to content

Performance impact due to No Fact caching #8955

@pemsith

Description

@pemsith

Describe the bug
The repository contains Ansible playbooks that gather and utilize facts but do not specify a persistent cache plugin in the ansible.cfg file. By default, the memory cache plugin is used, which only retains data during the current execution of Ansible and does not persist across runs. Without fact caching setup, it shows low performance due to repeated fact gathering and increased memory consumption during long or complex playbook executions. The absence of a persistent cache plugin impacts scalability and efficiency, especially when working with large inventories or multiple playbook runs.

Expected behavior
The request is to either add the below suggested in your repo delivered ansible.cfg files or make a strong recommendation for users to update it as such.
An appropriate cache plugin should be configured in ansible.cfg to persist facts across Ansible runs. Plugins such as jsonfile, redis, or yaml can be used to store facts persistently, reducing repeated fact gathering, improving performance, and minimizing memory consumption.

Expected example configuration in ansible.cfg:
fact_caching = jsonfile
fact_caching_connection = /path/to/fact_cache
fact_caching_timeout = 7200

Versions:

  • OS - CentOS stream 9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions