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

how PoolLimits soft and hard limits work? #708

Closed
dmfigol opened this issue Jan 2, 2020 · 3 comments
Closed

how PoolLimits soft and hard limits work? #708

dmfigol opened this issue Jan 2, 2020 · 3 comments
Labels
question Further information is requested

Comments

@dmfigol
Copy link

dmfigol commented Jan 2, 2020

Sorry, I couldn't find this anywhere.
Do you mind explaining what soft and hard limits actually do?

pool_limits = httpx.PoolLimits(soft_limit=20, hard_limit=100)
client = httpx.AsyncClient(pool_limits)

Thank you!

@florimondmanca florimondmanca added the question Further information is requested label Jan 2, 2020
@tomchristie
Copy link
Member

@dmfigol
Copy link
Author

dmfigol commented Jan 2, 2020

@tomchristie this is helpful, thank you!
Could you provide a little bit more details, what is the expected behavior when soft limit and hard limit are reached?
If I understood correctly when hard limit is reached, we will be just waiting for an existing connection to be released, but I have no idea about the soft one.

@tomchristie
Copy link
Member

Closing this in favour of #787.

what is the expected behavior when soft limit and hard limit are reached?

  • soft_limit reached: when a connection is closed, it gets fully closed, rather than staying in a keep-alive state for a bit.
  • hard_limit reached: cannot establish more connections than this limit. Attempts to make a new connection will wait until the configured pool timeout, and error if connection is made available within that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants