Skip to content
Myr

resource-limits.md

This file

Path

docs/advanced/resource-limits.md

13 lines · 596 bytes · Markdown

Last changed by

Docs restructuring. (#3049)Tom Christiebefore adoption8cd952c

History of this file

Take it

Docs restructuring. (#3049)Tom Christiebefore adoption8cd952c

lines 1–13why, one step back
1You can control the connection pool size using the `limits` keyword
2argument on the client. It takes instances of `httpx.Limits` which define:34- `max_keepalive_connections`, number of allowable keep-alive connections, or `None` to always5allow. (Defaults 20)6- `max_connections`, maximum number of allowable connections, or `None` for no limits.7(Default 100)8- `keepalive_expiry`, time limit on idle keep-alive connections in seconds, or `None` for no limits. (Default 5)910```python11limits = httpx.Limits(max_keepalive_connections=5, max_connections=10)12client = httpx.Client(limits=limits)13```