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

ANTA runner performance issues at high scale #647

Closed
carl-baillargeon opened this issue Apr 22, 2024 · 0 comments · Fixed by #654
Closed

ANTA runner performance issues at high scale #647

carl-baillargeon opened this issue Apr 22, 2024 · 0 comments · Fixed by #654
Labels
framework-enhancement New feature or request
Milestone

Comments

@carl-baillargeon
Copy link
Contributor

carl-baillargeon commented Apr 22, 2024

Tested ANTA on a fabric of 1040 devices and 2 606 033 tests. ANTA was run outside of the CLI, meaning no CLI tags were used. The catalog consisted of evenly distributed tests across devices, around 75% of the tests had filters (tags) for specific devices.

Used tqdm to monitor iterations per second (it/s) on various loops in the runner and cProfile.

Findings:

  1. Creating AntaTestRunner tuples from the tags for device in inventory.devices: --> 12 it/s (3h24m total)
    a. selected_tests.update((t, device) for t in catalog.tests if t.inputs.filters is None or t.inputs.filters.tags is None) --> 860 000 it/s (3-4 seconds per device)
    b. selected_tests.update((t, device) for t in catalog.get_tests_by_tags(device.tags)) --> 320 000 it/s (7-8 seconds per device)

  2. Creating coroutines for test_definition, device in selected_tests: --> 294 it/s (2h27m total)
    a. Looking at cProfile, most of time is spent in Pydantic, which makes sense since AntaCommand and AntaTemplate are Pydantic models.

    • to be addressed

    Here is a screenshot of the runner cProfile based on 45 000 tests:
    image

Other findings:

  1. await selected_inventory.connect_inventory() Here we connect to all devices of the inventory even though we might not run tests on these devices depending on the tags from the catalog/inventory.
    • to be addressed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework-enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants