r/FastAPI • u/International-Rub627 • Apr 02 '25
Hosting and deployment GCP Latency
I try to query GCP Big query table by using python big query client from my fastAPI. Filter is based on tuple values of two columns and date condition. Though I'm expecting few records, It goes on to scan all the table containing millions of records. Because of this, there is significant latency of >20 seconds even for retrieving single record. Could someone provide best practices to reduce this latency. FastAPI server is running on container in a private cloud (US).
1
Upvotes
View all comments
Show parent comment
2
u/HappyCathode Apr 03 '25
OP didn't require help, they required a solution. With almost no relevant information that could help give them one. How can you expect a community to vomit a solution to "reduce latency" when you don't even mention WHERE your API is running from ? They could be running their FastAPI server on a Raspberry Pi under a cellular connection 5000km away from their BigQuery setup region. That's even assuming OP meant "BigQuery" when they said "GCP query", because "GCP query" doesn't mean anything.
If the subs agrees that this is a correct and efficient way of asking for help, this douche is out of here.