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

Be more efficient about Foreman API calls #51

Closed
sadsfae opened this issue Mar 27, 2017 · 1 comment
Closed

Be more efficient about Foreman API calls #51

sadsfae opened this issue Mar 27, 2017 · 1 comment
Milestone

Comments

@sadsfae
Copy link
Member

sadsfae commented Mar 27, 2017

Clean up places where we're relying on hammer CLI calls per-host to query host parameters when we can do the work up front and query it cached in some other form or in general be more sparing about unnecessarily querying host parameters.

Example:

We can cut down on the number of needed Foreman calls substantially by removing the host list outside of the scope of the for loop here:

https://github.com/redhat-performance/quads/blob/master/bin/make-instackenv-json.sh#L51

In it's current implementation we're seeing way too many API calls in Foreman /var/log/production.log e.g.

2017-03-27 10:09:29 [app] [I]   Parameters: {"search"=>"params.nullos=false", "page"=>"1", "per_page"=>"1000", "apiv"=>"v2", :host=>{}}
2017-03-27 10:09:29 [app] [I] Authorized user admin(Admin User)
2017-03-27 10:09:30 [app] [I]   Rendered api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout (768.6ms)
2017-03-27 10:09:30 [app] [I] Completed 200 OK in 998ms (Views: 743.7ms | ActiveRecord: 110.2ms
cat /var/log/foreman/production.log | grep "params.nullos=false" | wc -l
4922
@sadsfae
Copy link
Member Author

sadsfae commented Mar 27, 2017

Related - https://review.gerrithub.io/#/c/354578/

@sadsfae sadsfae modified the milestone: 1.0 May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant