Skip to content

Increase performance of 'icinga2_object' #389

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Donien
Copy link
Member

@Donien Donien commented Jul 9, 2025

This PR does the following:

  • Merge icinga2_objects in RAM
    Objects are now merged in memory instead of writing them to files and then merging them after the fact.
    They are still separated into multiple files if decided by the user (e.g. every host could have their own file or all hosts could share the same file; the latter is more time efficient).
    This yields a great performance increase (up to 80% time savings)

  • Drop the order parameter
    The order parameter used in objects is no longer taken into account.
    If order is used in icinga2_objects, there will be a deprecation warning. Other than that it will just be ignored for now (order of objects is now down through python sorting a list of dictionaries (objects) to keep idempotency).

  • Change structure in /var/tmp/icinga/
    Since files are no longer assembled, the directory structure needed to change a bit.
    If running the new approach in an old environment, the directory structure will not be correct. What is now being treated as a file path has been a directory path previously (target_path.conf/ vs. target_path.conf).
    Writing objects will fail!

    There is an easy, one-time fix: Delete /var/tmp/icinga/ once.
    This removes the old structure and makes room for the new one.

    This is also noted in the changelog fragment.

Side note: In the future we could get rid off writing to /var/tmp/icinga altogether since this was only used to have a place in which to assemble multiple files into new ones.

@Donien Donien requested a review from mkayontour July 9, 2025 13:23
@Donien
Copy link
Member Author

Donien commented Jul 9, 2025

This might close #338 and #339.

Closes #386

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.

1 participant