Skip to main content

Automatic aiohttp ClientSession management

Project description

A module to automatically manage aiohttp.ClientSession objects for you to improve performance.

The package manages a global cache of aiohttp.ClientSession objects based on the host a particular request is connecting to so connections can be reused between requests.

It also simplifies the API.


The usage is similar to the python requests library:

import aiohttp_client
async with aiohttp_client.get('') as resp:
    # do something here


Uses env variables to configure max number of reqeusts/sessions to manage:

  • AIOHTTP_SESSION_SIZE: max number of sessions to keep in cache(default 200)

  • AIOHTTP_SESSION_DNS_CACHE: number of seconds to keep dns lookup in cache(default 20)

  • AIOHTTP_SESSION_LIMIT: number of simultaneous connections to have per session(default 500)

1.1.2 (2022-10-20)

  • Change to bsd license

1.1.1 (2020-04-15)

  • better session connector defaults

1.1.0 (2019-06-06)

  • update max requests and sessions

  • Updated to point to

1.0.0 (2018-04-09)

  • initial release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiohttp_client_manager-1.1.2.tar.gz (3.7 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page