Skip to content

Change ansible fact caching from jsonfile to memory for better performance#1502

Merged
liat-grozovik merged 1 commit intosonic-net:masterfrom
wangxin:ansible-fact-caching-memory
Mar 30, 2020
Merged

Change ansible fact caching from jsonfile to memory for better performance#1502
liat-grozovik merged 1 commit intosonic-net:masterfrom
wangxin:ansible-fact-caching-memory

Conversation

@wangxin
Copy link
Collaborator

@wangxin wangxin commented Mar 28, 2020

Description of PR

Summary:
Fixes # (issue)

Changing ansible fact_caching from jsonfile to memory does not affect the test execution and can reduce around 20% of the overall test executing time.

The reason is that ansible needs to parse and process all the cached facts before running EACH task in playbook. Currently the fact_caching_timeout in ansible/ansible.cfg is set to 86400. The size of cached facts could accumulate to mega bytes. If all the facts are stored in jsonfile, then it may need nearly 1 second to parse and process the cached facts for each task. In our regression testing, we observed that CRM testing on t1-lag topology originally needs more than 2 hours to complete. With this change, it needs just around 40 minutes.

If we change fact_caching method from jsonfile to memory, the cached facts are not persistent between ansible-playbook executions. But so far, the ansible playbooks do not need old cached facts. This change is safe.

Type of change

  • [] Bug fix
  • Testbed and Framework(new/improvement)
  • [] Test case(new/improvement)

Approach

How did you do it?

Change fact_caching from jsonfile to memory in ansible.cfg

How did you verify/test it?

Tested in Mellanox lab.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

…mance

Changing ansible fact_caching from jsonfile to memory does
not affect the test execution and can reduce around 20% of
the overall test executing time.

Signed-off-by: Xin Wang <[email protected]>
@liat-grozovik liat-grozovik merged commit ce11942 into sonic-net:master Mar 30, 2020
@wangxin wangxin deleted the ansible-fact-caching-memory branch June 10, 2020 12:57
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…tilites submodules (sonic-net#7209)

sonic-swss
-[SFlowMgr] Sflow Crash on 200G ports handled (sonic-net#1683)
-Stablize the test case (sonic-net#1679)
-Remove PGs from an administratively down port. (sonic-net#1677)

sonic-swss-common
- fix getting hash from redis db (sonic-net#465)
- [dbconnector] Initialize redisContext (sonic-net#464)

sonic-utilities
- route_check: Fix hanging & logging level (sonic-net#1520)
- Add self timeout and crash if exceeded. (sonic-net#1502)
- [reboot] User-friendly reboot cause message for kernel panic (sonic-net#1486)
- [acl-loader]: do not add default deny rule for egress acl (sonic-net#1531)

Signed-off-by: Danny Allen <[email protected]>
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
209b7ddec109587ddeb90071ca23ae6a288b1442 (HEAD -> 201911, origin/201911) Fixed the possibility of using uninitialized variable in route_check.py (sonic-net#1551)
e30387cbebaaccbf9385059b1e501955c40be338 route_check: Fix hanging & logging level (sonic-net#1520)
3c8de6950615a4608a80e3d47ea678f8e8487186 Add self timeout and crash if exceeded. (sonic-net#1502)

Signed-off-by: Abhishek Dosi <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants