-
Notifications
You must be signed in to change notification settings - Fork 63
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
Reuse persistent HTTP connections #124
Comments
Summary from original issue + updates:
@yaacov told me it'd be possible to modify our metrics capture to do much fewer batch queries, both with hawkular and prometheus, potentially making this non-issue. |
@miq-bot Cannot apply the following labels because they are not recognized: providers/containers, providers/hawkular |
@miq-bot unrecognized command 'Cannot', ignoring... Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone |
This issue has been automatically marked as stale because it has not been updated for at least 6 months. If you can still reproduce this issue on the current release or on Thank you for all your contributions! |
@cben Would you have an idea of the sizing of this issue? S / M / L / XL. |
@miq-bot Cannot apply the following labels because they are not recognized:
All labels for |
@miq-bot unrecognized command 'Cannot', ignoring... Accepted commands are: add_label, add_reviewer, request_review, assign, close_issue, cross_repo_test, move_issue, remove_label, rm_label, remove_reviewer, set_milestone, unassign |
Removes bot thinking it is calling itself when making a comment where it's username could be used when adding a label. See the following for an example: ManageIQ/manageiq-providers-kubernetes#124 (comment)
Kubeclient 4 used rest-client, which is no longer maintained, and doesn't support persistent connections: rest-client/rest-client#453 Kubeclient 5.0 will support this, at least partially.
|
@miq-bot unrecognized command 'unrecognized', ignoring... Accepted commands are: add_label, add_reviewer, request_review, assign, close_issue, cross_repo_test, move_issue, remove_label, rm_label, remove_reviewer, set_milestone, unassign |
I noticed recently we don't reuse HTTP connections. A new TCP/TLS/HTTP connection every request may add up to an order of magnitude speed difference:
https://bibwild.wordpress.com/2012/04/30/ruby-http-performance-shootout-redux/
HawkularClient creates a new RestClient instance for every single call.
Kubeclient does cache RestClient instance, but RestClient itself doesn't support connection reuse!
Connection reuse rest-client/rest-client#453
[?] Net::HTTP when used directly does support persistent connections in limited scenarios (passing a block to .start). I believe we use it through MiqFs for image scanning, not sure how exactly.
[?] @yaacov also told me one of the client libs (
maybe in python though?) does API discovery anew before every single action.P.S. new connections are probably more expensive when going through proxies, e.g. to hawkular running in a pod?
After some reading, for fresh developement, httpclient or excon could be better than restclient, on several aspects.
For our existing code, https://github.com/drbrain/net-http-persistent (co-authored by tenderlove :-) sounds a good start. I propose trying quick&dirty patch to use it in RestClient (and MiqFs), measuring how much we stand to gain, and working with RestClient to add at least opt-in option.
@miq-bot add-label providers/containers, providers/hawkular, performance
/cc @lucasponce
Probably happens with other providers, a quick search through Gemfile.lock shows only excon used by fog & OpenstackHandle, httpclient used by WinRm.
This issue was moved to this repository from ManageIQ/manageiq#13345, originally opened by @cben
The text was updated successfully, but these errors were encountered: