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

Execution speed improvement for check_puppet_agent #20

Open
sergiik opened this issue Mar 15, 2016 · 2 comments
Open

Execution speed improvement for check_puppet_agent #20

sergiik opened this issue Mar 15, 2016 · 2 comments

Comments

@sergiik
Copy link

sergiik commented Mar 15, 2016

Hi,
Right now most of time script spends in running 'puppet config print' 4 times. It's inefficient and causes noticeable runtime for the script. It's not a big deal but when monitoring system is running many small scripts it's better to have them running in efficient way so that total execution time for monitoring and load is as small as possible. It would be nice to have all needed options requested with one 'puppet config print' run.

@aswen
Copy link
Owner

aswen commented Mar 22, 2016

Hi @sergiik : I agree to your comment. I might execute the configprint once and write everything to a temp file or parse it into variables at once.
It might take a while though before I do so but feel free to build something nice and create a Pull request if I'm not fast enough ;-)

@jgrammen-agilitypr
Copy link
Contributor

Just a note about performance, it appears that the two calls out to the puppet service itself, 1 to determine the major version and 1 to get the necessary configuration settings, total about 1.6 seconds total of execution time. 0.8 seconds per call. So improving the script beyond 1.6 seconds per run would be very difficult, unless there are alternative techniques for retrieving the desired values.
In my environment I am going to set the major version statically (or maybe via a parameter), which gets the execution time to down around 0.8 seconds.

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