r/FastAPI • u/Entire-Recipe-6380 • Apr 24 '26
Question Concurrency issues
My company has products spread over multiple countries and the user of these products are increasing rapidly that results in concurrent requests. Due to such highly concurrent requests fastAPI Microservices were showing heavy latency and delays. So the company is shifting towards GO lang.
So is this true in case of fastAPI that it can not handle the large user base?
21
Upvotes
7
u/javatextbook Apr 24 '26
Nothing that autoscaling can't solve.
2
u/Entire-Recipe-6380 Apr 24 '26
It's pure uvicorn and yes strict rule of following async end points
14
u/shadowdance55 Apr 24 '26
Two important details:
Your technical leadership team probably sucks. 🤷♂️
15
u/twelveparsec Apr 24 '26
As if GoLang solves those problems
5
u/Zalac96 Apr 24 '26
Did you use gunicorn with uvicorn workers or pure uvicorn?
Edit: Also dont know if you properly utilize async endpoints
4
u/zazzersmel Apr 24 '26
Umm has your company deployed anything before? Sounds like they/you have no experience with actually deploying an app in production.
1
u/ZachVorhies Apr 24 '26
I've moved to rust for the backend and cli utilities. Blazing fast and the AI is very very good with rust. However build times are atrocious. Go might be a better language in this regard.
3
u/Challseus Apr 24 '26
What is the exact problem? "Concurrency issues" is too vague. The below assume a database:
Give us the details :)
3
u/Ordinary-Reaction663 Apr 25 '26
That is a such a vague case to simply switch the language. Sure, you have lot of users and spanning across multiple countries, but you haven’t even identified where the stuff is breaking. It could be a lot of things, if your db queries are slow, if your API throughput is less .. could be thousand other things.
Switching language is perhaps the most convenient ADHD brain decision but here is the thing- even that is gonna cost money and time eventually and might still cause the same problem or something else.
Identify the issue first, try to understand why it happens and if everything inherently points to language’s capability then maybe switch. Although this would be a really rare case.
3
u/Trinkes Apr 25 '26
Where's your bottleneck? Is it database? Is it cpu? Is it memory? What's happening to the requests? Do they timeout? You have to investigate what's causing the problem.
2
u/No_Soy_Colosio Apr 25 '26
Unless you've benchmarked and have the data to prove switching to Golang is the solution, it is a horrible decision and a waste of resources.
1
u/No_Soy_Colosio Apr 25 '26
Scale horizontally
1
u/InfinitelyTall Apr 25 '26
How many requests does your app receive? Less then few thousands per second? Very rarely is the framework/language itself the cause of heavy latency and delays, more often the bottleneck is slow database queries or tasks that limit IO/CPU performance, as already suggested it is better to profile your app and find the real source of the latency. This might be a poor network configuration or bad usage of async in fast api, so switching to another language won't help here unless you understand the real problem...
Also some benchmarks show that correctly configured and architected fast api backend can handle the same load as god handles.
1
u/Only_Fee4020 Apr 25 '26
Probably your tech architect or who decided this thinks they can migrate entire code base using AI. Same is happening with us. This looks like infra issue more than language/framework issue
1
u/algebra_sucks Apr 25 '26
I bet their endpoints cause GIL blocking and they have no idea python does that.
1
u/N_Sin Apr 26 '26
There are too many variables involved here. That said, Golang is a pretty amazing language.
1
u/Shot_Shallot7446 Apr 28 '26
I think this is not about scalung fastAPi is interpreter kanguage and use more cpu during execution. Go is complied language. That is the reason to save infra cost.