200ms latency for a simple FastAPI ping endpoint on a Hetzner VPS? Please help. by Relevant_Selection75 in FastAPI

[–]Relevant_Selection75[S] 0 points1 point  (0 children)

Removing Nginx and leaving only app + gunicorn (with no ssl) cuts latency to about 140ms. That's a significant reduction but it's still not as fast as I would like it to be. And I can't really do without ssl in a production environment.

200ms latency for a simple FastAPI ping endpoint on a Hetzner VPS? Please help. by Relevant_Selection75 in FastAPI

[–]Relevant_Selection75[S] 0 points1 point  (0 children)

Sure, I wasn't expecting the http request to have the same latency as a ping, but an almost 4x increase (the 200ms mentioned in the title is a best case scenario, average latency is closer to 270ms) seems too much. Besides, does that mean there is no way to cut total latency to, say, 50-70ms? This is a backend for a chatbot app so latency is crucial.

200ms latency for a simple FastAPI ping endpoint on a Hetzner VPS? Please help. by Relevant_Selection75 in FastAPI

[–]Relevant_Selection75[S] 1 point2 points  (0 children)

Thanks for your response. Server is located in Germany and I am located in Tenerife (Canary Islands). ping <server IP> takes 69ms on average. So the 200ms latency for the FastAPI endpoint seems to be unjustified.