| 1 |
You can control the connection pool size using the `limits` keyword |
| 2 |
argument on the client. It takes instances of `httpx.Limits` which define: |
| 3 |
|
| 4 |
- `max_keepalive_connections`, number of allowable keep-alive connections, or `None` to always |
| 5 |
allow. (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) |
| 9 |
|
| 10 |
```python |
| 11 |
limits = httpx.Limits(max_keepalive_connections=5, max_connections=10) |
| 12 |
client = httpx.Client(limits=limits) |
| 13 |
``` |