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

Reduce chaperone Load by Pruning Special FS Types from find Searches #1

Open
arno01 opened this issue Nov 2, 2023 · 5 comments
Open

Comments

@arno01
Copy link

arno01 commented Nov 2, 2023

The chaperone utility employs the command find / -type f ... to search through pods.

This search inadvertently includes non-filesystem-based paths such as /proc, /sys, etc.

Such inclusion not only generates additional processing load but can also lead to issues. I recall instances from a few years ago when the find / command would get indefinitely stuck.

I recommend using the command find / \( -fstype proc -o -fstype sysfs -o -fstype tmpfs \) -prune -o -type f to specifically exclude special filesystem types like proc, sysfs, and tmpfs.

In this instance, a single find command unnecessarily scans an additional 62,201 files.

image

@88plug

@arno01
Copy link
Author

arno01 commented Nov 2, 2023

I'm not certain about the frequency of the operation - whether it's every 1 or 5 minutes - but I would suggest extending the interval to at least 10 minutes.

I would generally recommend using inotifywatch, as it can eliminate the need to repeatedly scan all the data.

@88plug
Copy link
Contributor

88plug commented Nov 3, 2023

I recommend using the command find / \( -fstype proc -o -fstype sysfs -o -fstype tmpfs \) -prune -o -type f to specifically exclude special filesystem types like proc, sysfs, and tmpfs.

This was in some initial releases, go ahead and propose the change.

@88plug
Copy link
Contributor

88plug commented Nov 3, 2023

I'm not certain about the frequency of the operation - whether it's every 1 or 5 minutes - but I would suggest extending the interval to at least 10 minutes.


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='Check for issues in Kubernetes pods.')
    parser.add_argument('--delete-namespaces', action='store_true', help='Delete namespaces that have issues.')
    parser.add_argument('--discord', action='store_true', help='Send notifications to Discord when deleting namespaces.')
    parser.add_argument('--pushover', action='store_true', help='Send notifications to Pushover when deleting namespaces.')
    parser.add_argument('--time', type=str, default="", help='Run the application for a given time duration. Examples: --1h, --10m, --forever.')

    args = parser.parse_args()

    time_mapping = {
        'forever': None,
        '1h': 3600,
        '10m': 600,
        '1m': 60,
        '30s': 30,
        # Add more mappings here
    }

is how it works, you use arguments to control Chaperone.

@88plug
Copy link
Contributor

88plug commented Nov 3, 2023

I would generally recommend using inotifywatch, as it can eliminate the need to repeatedly scan all the data.

The app watches pods, not data.

@andy108369
Copy link

I would generally recommend using inotifywatch, as it can eliminate the need to repeatedly scan all the data.

The app watches pods, not data.

"Watches the pods" implies scanning their data ("data" - in the context of the data paths, i.e. the directories, filenames; obviously not the contents).

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

3 participants