Too high latency
Anonymous
HOBBYOP

3 months ago

A simple health check view
@api.get("/health")
async def health():
"""Health check endpoint."""
return {"status": "healthy", "timestamp": time.time()}

is giving a latency of 300 ms to 500 ms.
I am on a hobby plan . How do I fix this?

https://check-host.net/check-http?host=https://gallant-adaptation-production-f6d4.up.railway.app/health&csrf_token=d42c132c580a50c1a9519993ecf1b3dd916e32d6

7 Replies

3 months ago

Are you using FastAPI?


3 months ago

Also any chance you have some middleware running on that endpoint?


Anonymous
HOBBYOP

3 months ago

No, I am using django-bolt https://github.com/FarhanAliRaza/django-bolt . It is using basic middleware like cors and compression.


Anonymous
HOBBYOP

3 months ago

On localhost, the average latency is under 5 ms.


3 months ago

use this command to diag the issue and send the output to any chatbot and get details.

curl -w "namelookup:%{time_namelookup} connect:%{time_connect} tls:%{time_appconnect} ttfb:%{time_starttransfer} total:%{time_total}\n" -o /dev/null -s https://gallant-adaptation-production-f6d4.up.railway.app/health

there is a thread on my side about this issue.


3 months ago

consider the roundtrip of a request on global network is different with your localhost.


3 months ago

Dear Alireza,
Change the region and its helpful.

https://station.railway.com/questions/metrics-are-wierd-687c0f49


Loading...