Concurrent requests take forever to be executed #3151
Answered
by
zanieb
novitae
asked this question in
Potential Issue
Answered by
zanieb
Mar 22, 2024
Replies: 1 comment 6 replies
|
Why are you creating 100 clients and sending a single request with each? Instead you should use a single client to send hundreds of requests. It sounds like you're running into a simple network saturation, since you're creating each client separately each request is sent on a new connection instead of sharing an existing connection. As each client creates a new connection, you eventually run into a timeout error since establishing new connections takes time and usually there's an upper bound on the number of concurrent connections you can have. |
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment




I'm pretty sure that does not automatically create a session for you in httpx, I think you want something like this: