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

Use the same connection for requests for performance gain #553

Open
kaspernj opened this issue Feb 9, 2020 · 0 comments · May be fixed by #555
Open

Use the same connection for requests for performance gain #553

kaspernj opened this issue Feb 9, 2020 · 0 comments · May be fixed by #555

Comments

@kaspernj
Copy link
Contributor

kaspernj commented Feb 9, 2020

I would suggest caching the value of the following method:
https://github.com/swipely/docker-api/blob/fc7ad57f77d59036dba9598ed52772778dc198c6/lib/docker/connection.rb#L29-L33

I guess from reading the code that Excon currently creates a whole new connection for each command executed on Docker?

In my app we send a lot of commands to many different Docker containers. I think it would greatly increase the speed if it continued to use the already open connection.

I have noticed the comment about bad requests and to solve that issue maybe we could nullify to connection instance variable when we register a bad request from the HTTP status code?

Or maybe it could be an option to cache the value? Then people who experience issues with bad requests could not opt in (or opt out)?

@kaspernj kaspernj linked a pull request Feb 16, 2020 that will close this issue
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 a pull request may close this issue.

1 participant