Open eliran89c opened 5 months ago
Concurrency and asynchronous call is natively supportted by FastAPI, I did a quick test with 2 concurrency requests (with long response) and I can see both are streaming in parallel, I didn't test via code though.
You can probably try below:
Hi @daixba, I forgot to mention that I'm not streaming the response With streaming, it works better, but it is still not perfect (I monitor the health-check endpoint, and it times out from time to time)
But without streaming, the API is waiting for each request to finish before being able to handle other requests
Concurrency and asynchronous call is natively supported by FastAPI
I agree; This is why I think the problem with boto3
@daixba when I run boto3 with asyncio it's working as expected https://github.com/aws-samples/bedrock-access-gateway/pull/23
所以这个能解决吗,我的大并发请求一遇到非流式就没办法
Describe the Bug I am encountering an issue where concurrent requests are being processed sequentially rather than simultaneously when deployed on AWS Fargate. I suspect the problem is that boto3 runs synchronously, and its calls are blocking.
API Details
To Reproduce Steps to reproduce the behavior:
Expected Behavior I expected that when sending multiple concurrent requests to the API, all requests would be handled simultaneously or at least as many as the server can handle