Code Monkey home page Code Monkey logo

Comments (6)

vdemeester avatar vdemeester commented on July 28, 2024

Hi @nishanttotla , what would be the use case ? (/me curious 👼)

from engine-api.

nishanttotla avatar nishanttotla commented on July 28, 2024

@vdemeester in Swarm, we have this function

func closeIdleConnections(client *http.Client) {
    if tr, ok := client.Transport.(*http.Transport); ok {
        tr.CloseIdleConnections()
    }
}

that needs the http client. At a couple of other places, we also pass requests to the agent Engines directly. Perhaps @vieux or @dongluochen know better about the reasoning behind that.

from engine-api.

dongluochen avatar dongluochen commented on July 28, 2024

There are several use cases to set HTTP client parameters:

  1. Users want to set MaxIdleConnsPerHost and DisableKeepAlives to control the number of TCP connections for a cluster. The manager becomes a bottleneck in a large cluster.
  2. TCP dead peer detection. If a receiver disappears abruptly, it'd take very long (15 min on Linux default settings) to detect connection failure. TCP user timeout can reduce this detection time. See samalba/dockerclient#202.

from engine-api.

calavera avatar calavera commented on July 28, 2024

You can initialize a client outside and pass it to the API:

https://github.com/docker/engine-api/blob/master/client/client.go#L69

You can do whatever you want with it without having to expose it again from within the API.

from engine-api.

nishanttotla avatar nishanttotla commented on July 28, 2024

@calavera that's pretty much what we currently do - create the client using samalba/dockerclient, then pass it on to engine-api, and were hoping to only use the latter.

from engine-api.

nishanttotla avatar nishanttotla commented on July 28, 2024

Closing this issue, because we're fixing it in Swarm: docker-archive/classicswarm#2206

from engine-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.