Skip to content

Use the same connection for requests for performance gain #553

Open
@kaspernj

Description

@kaspernj

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)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions