Skip to content

Can't tune maxsize of connection pool used #290

Closed

Description

@yuvipanda

I get a lot of log messages of the form:

WARNING:urllib3.connectionpool:Connection pool is full, discarding connection: 10.0.0.1

Setting maxsize of HTTPConnectionPool (or equivalent object) to something higher would help with this, and with connection re-use help performance too (I am hoping!). I can't seem to find a way to set this though!

Activity

  1. yuvipanda commented on Jul 9, 2017

    @yuvipanda
    ContributorAuthor

    Ideally, it'll be a param to kubernetes.config.configuration that can be tuned.

  2. yuvipanda commented on Jul 9, 2017

    @yuvipanda
    ContributorAuthor

    However, the kubernetes.config.configuration object says it is autogenerated - but am unable to find where it is autogenerated from?

  3. mbohlool commented on Jul 9, 2017

    @mbohlool
    Contributor

    kubernetes.config.configuration is not auto generated anymore, you can edit it. Please also remove the message that it said it is auto-generated. Thanks for your contribution.

  4. yuvipanda commented on Jul 9, 2017

    @yuvipanda
    ContributorAuthor

    Thanks @mbohlool! kubernetes-client/python-base#18 should do the trick I think.

  5. s1113950 commented on Sep 28, 2018

    @s1113950

    kubernetes.config.configuration is not auto generated anymore, you can edit it. Please also remove the message that it said it is auto-generated. Thanks for your contribution.

    @mbohlool @yuvipanda how can you edit this? I have this setting because I'm threading grabbing pod information and ran into the connection pool issue above:

    client_config = client.Configuration()
    client_config.connection_pool_maxsize = 200
    config.load_kube_config(client_configuration=client_config)
    v1 = client.CoreV1Api()
    

    if I then call pods = v1.list_namespaced_pod(namespace) I get an error where it hits localhost rather than using my kubeconfig.

    I checked out the code here: https://github.com/kubernetes-client/python-base/blob/master/config/kube_config.py#L522 and thought that if I just pass in the client_configuration with the changed pool size it'd use that, but I'm overwriting something I don't mean to.

  6. mbohlool commented on Sep 28, 2018

    @mbohlool
    Contributor

    you need to pass your client_config to client.CoreV1Api() call otherwise it will use the default one which is localhost. it should be something like client.CoreV1Api(config=client_config)

  7. s1113950 commented on Oct 1, 2018

    @s1113950

    Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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