High latency

shxkm
PRO

5 months ago

Is it expected to have much higher latency on the Hobby plan? My WSGI server is mostly responding in 2 digit ms, but curl timing shows 700-1000ms response times.

If that’s expected because routing is somehow loaded, I’m OK with that. Just wondering if that’s a factor.

0 Replies

shxkm
PRO

5 months ago

1b0d51d3-f173-4fd6-bf29-f0025eae2d1a


5 months ago

I think this is a service specific issue - my services are showing 100-200ms on public domain


5 months ago

Are you putting your service in a distant region (e.g. us -> eu)?


shxkm
PRO

5 months ago

Yes. I’m in EU, all services are in US. I’ll check this direction once Amsterdam becomes available. Just don’t want to waste time if it’s something with Hobby. 1000ms is on the higher end and as stated the server itself is returning pretty fast.


5 months ago

Do you have traces enabled to back that up?

It's not a hobby specific issue, railway doesn't change networking based on your plan


shxkm
PRO

5 months ago

I have the WSGI server logs which measure the time from the time the request is received and until it's fully processed.


shxkm
PRO

5 months ago

     time_namelookup:  0.002090s
        time_connect:  0.070697s
     time_appconnect:  0.279802s
    time_pretransfer:  0.279955s
       time_redirect:  0.000000s
  time_starttransfer:  0.681046s
                     ----------
          time_total:  0.681129s
100.64.0.3 - - [06/Feb/2025:12:42:16 +0000] 'GET /[REDACTED] HTTP/1.1' 302 0 '-' 'curl/8.7.1' in 21823µs

shxkm
PRO

5 months ago

And a lot more. Pretty sure most of the time is happening outside the WSGI server.

     time_namelookup:  0.112218s
        time_connect:  0.189007s
     time_appconnect:  0.343297s
    time_pretransfer:  0.343528s
       time_redirect:  0.000000s
  time_starttransfer:  0.750120s
                     ----------
          time_total:  0.750215s
100.64.0.6 - - [06/Feb/2025:12:58:18 +0000] 'GET /REDACTED HTTP/1.1' 302 0 '-' 'curl/8.7.1' in 24472µs

shxkm
PRO

5 months ago

I'm willing to deploy a route that simply returns a 200 without any processing if that will help looking into this.


shxkm
PRO

5 months ago

Even health check route that’s returning 3000 microseconds is taking 700ms to reach. This is too much for geography to account for.


5 months ago

The last time someone in the help thread was having latency issues was related to not being on runtime v2


5 months ago

Just out of curiosity, is this service of yours on the runtime v2?


5 months ago

was it created after 2024/06/04 (YYYY/MM/DD)?


shxkm
PRO

5 months ago

Yeah, I saw that thread while researching. The service is less than a week old. And I verified that it’s on V2.


shxkm
PRO

5 months ago

I’m gonna try to move it to us-east-1 (alongside DB and Redis) and see if that makes any difference.


shxkm
PRO

5 months ago

Oh, I can’t move Postgres to us-east-1.


shxkm
PRO

5 months ago

Quite interesting. Even with the DB in another region, I’m seeing sub 500ms responses for the first time. Still far too slow.


shxkm
PRO

5 months ago

Oh, I can’t in the Hobby plan.


5 months ago

make sure your app and db are in the same region!


5 months ago

same zone too


shxkm
PRO

5 months ago

They are


shxkm
PRO

5 months ago

The response times I’ve listed include the trips to the DB.


5 months ago

Then yeah just looks like it's geographical distance coming into play now


shxkm
PRO

5 months ago

That’s interesting


shxkm
PRO

5 months ago

I think it’s still too much to account for that


5 months ago

got a command you'd like me to run? I'm closer to US-West than you are


shxkm
PRO

5 months ago

EDITED OUT


5 months ago

what do you use for these printouts?


shxkm
PRO

5 months ago

the first one's source is based on: https://stackoverflow.com/a/22625150/14207055


shxkm
PRO

5 months ago

the 2nd is server logs from Railway (which I can access)


5 months ago

yay windows option too


shxkm
PRO

5 months ago

oh Brody, I'm so sorry for you


5 months ago

     time_namelookup:  0.018679s
        time_connect:  0.050818s
     time_appconnect:  0.323807s
    time_pretransfer:  0.323857s
       time_redirect:  0.000000s
  time_starttransfer:  0.508170s
                     ----------
          time_total:  0.508457s

5 months ago

and here is a request to a service on us-east metal (i am much more east) -

>curltime.bat https://utilities-metal.up.railway.app/ok200
     time_namelookup:  0.048874s
        time_connect:  0.100423s
     time_appconnect:  0.155786s
    time_pretransfer:  0.155836s
       time_redirect:  0.000000s
  time_starttransfer:  0.270153s
                     ----------
          time_total:  0.270172s

shxkm
PRO

5 months ago

that's more like the number I'd like to see (270ms) since this route is doing absolutely nothing.
500ms for that seem a bit high for me, especially since for [SOME COMPETITOR], even a US route is returning at sub 250ms consistently (and that route is doing something).


5 months ago

270ms*


shxkm
PRO

5 months ago

yeah yeah, sorry


shxkm
PRO

5 months ago

fixed that typo


5 months ago

so yeah this is just a distance thing


shxkm
PRO

5 months ago

I'm doubtful it's all due to geolocation. I'm sure some of it is, 500ms seems much.
Again, I'm seeing servers in California returning a response at sub 250ms consistently for another provider, and that's for a route I know has to do some lookups.
At first I thought "yeah they're much better engineers / using better mechanisms / etc…", but then I saw my server response times, and even the route I gave you at /up does literally nothing.
I guess I'll wait for Amsterdam to see and evaluate my options.


shxkm
PRO

5 months ago

100.64.0.3 - - [06/Feb/2025:16:51:21 +0000] 'GET /up HTTP/1.1' 301 0 '-' 'curl/8.7.1' in 1225µs

5 months ago

did you want me to run the utilities in Amsterdam?


shxkm
PRO

5 months ago

no no, what I'm saying is that Railway US west vs a competitor hosted elsewhere US west is a no contest.
My route that does nothing takes >700ms from where I am, theirs takes less than 280ms 99% of the time.
Something may be missing in my tests, but I'll have to evaluate.


shxkm
PRO

5 months ago

That's why I'd like to wait to Amsterdam, because I'm much closer to it, in order to weigh on how much latency Railway's LBs or whatever add into the mix.


5 months ago

yeah and thats why i offered to run the utilities in Amsterdam


shxkm
PRO

5 months ago

sorry, I don't get the point of that (meaning, I literally don't understand the purpose of that test)


shxkm
PRO

5 months ago

can you elaborate?


5 months ago

you want to deploy something to Amsterdam.
you cannot deploy something to Amsterdam since you are hobby.
i have offered to deploy something to Amsterdam for you.


shxkm
PRO

5 months ago

Like, my app? Or the test app you’re using? Either way sounds interesting


5 months ago

my test app, you mentioned you just want something that returns 200


shxkm
PRO

5 months ago

Sure. Thank you.


5 months ago

will do


5 months ago

done -


5 months ago

gcp since eu-west metal isnt ready for workloads yet


shxkm
PRO

5 months ago

Between 0.25-0.5 seconds


shxkm
PRO

5 months ago

Same app deployed in US east in another provider:

     time_namelookup:  0.002456s
        time_connect:  0.016633s
     time_appconnect:  0.146623s
    time_pretransfer:  0.146761s
       time_redirect:  0.000000s
  time_starttransfer:  0.328444s
                     ----------
          time_total:  0.328547s

Would be awesome if Railway engineers were at least willing to conisder this.


5 months ago

consider what?


shxkm
PRO

5 months ago

consider that Railway adds significant latency


shxkm
PRO

5 months ago

that cannot be accounted for due to geography, or application code


5 months ago

theres a lot more that goes into play that railway cannot control


shxkm
PRO

5 months ago

I'm sure but when it's +2x than the competitors, I'd at least want to rule that out. But, it's understandable.


5 months ago

try us east metal -


5 months ago

i guess it wont make a difference the edge proxies are still gcp


shxkm
PRO

5 months ago

I can't move the DB to US east (yet).
I guess I'll give Pro a spin soon enough to make a fair assessment.


5 months ago

let me know how that works!


shxkm
PRO

5 months ago

With Pro, i'll be able to move the DB off west and to east right?


5 months ago

yep, and even to EU


shxkm
PRO

5 months ago

us-east-1 is much better than us-west-1
around 0.45-0.50s most times, still slower than the competition
Trying Amsterdam


5 months ago

in my humble opinion, you should wait until we have the edge proxies on metal too, then make your final decision, right now, no matter if you use gcp or metal, you are still talking to gcp first


shxkm
PRO

5 months ago

in my humble opinion, you should wait until we have the edge proxies on metal too
Is there an ETA?

I very much like Railway, and have some time to decide.


shxkm
PRO

5 months ago

been banging my head trying to deploy properly on that other platform


shxkm
PRO

5 months ago

So Brody do you mean that right now on Metal, even though the machines are better, you're still "behind" gcp?


shxkm
PRO

5 months ago

Because I just moved to Amsterdam, and this is pretty sweet:

     time_namelookup:  0.002964s
        time_connect:  0.080993s
     time_appconnect:  0.157722s
    time_pretransfer:  0.158244s
       time_redirect:  0.000000s
  time_starttransfer:  0.231267s

Even though it's not metal.


5 months ago

yes your http request still hits our edge proxy on gcp first no matter what, eta for proxy on metal should be by the end of this Q


shxkm
PRO

5 months ago

so if I understand correctly, non-metal already have edge-proxies?


5 months ago

i mean metal or non-metal, any http request will still hit the edge proxies that are gcp only right now


shxkm
PRO

5 months ago

oh, got it


5 months ago

metal edge proxies coming by the end of this Q, hopefully at least.

our metal data centers have better routing and better isp hookups, so the time should improve, at least thats the goal


shxkm
PRO

5 months ago

OK, tested the same exact route.

Railway in Amsterdam (DB & Redis in the same region), 4,500 km:
0.706260s
0.579180s
0.372202s

Competitor in Frankfurt, 4,000 km:
0.287137s
0.290455s
0.288477s

us-east-1 vs. us-east-1: competition (from my location) just blows Railway away.

Railway's deployment flow and UI are light years more convenient to me, but this service is going to be a bit sensitive in terms of timing.
I'm definitely looking forward to edge proxies and hopefully don't have to make the decision before then. Reverting to Hobby until then and will test again.


5 months ago

drop the competitor's name, this is a safe space


shxkm
PRO

5 months ago

Vercel.
I didn't want to come off as trying to spam/advertise. Thank you.


5 months ago

ah yea AWS, they have far better routing than GCP


5 months ago

hopefully metal will have better than both, but only time will tell


shxkm
PRO

5 months ago

Yeah. In my day job I work extensively with all 3 cloud providers directly and have been doing so for >4 years. My guess of why Railway picked GCP is startup credits (totally legit) because working with the product (GCP) sometimes feels hostile. Hopefully metal routing will be comparable.


5 months ago

from what ive heard, we picked gcp because its more put together than aws, more well rounded, seems like a cohesive product, could be wrong, who knows, long pre-dates my time with railway


shxkm
PRO

5 months ago

Let’s see what happens with the in-house proxies. One thing is sure: I wouldn’t even have stayed with Railway if not for your help (in ~Jan 2024 you helped me put together my first project on here)


5 months ago

ouuuu tell me about this project


shxkm
PRO

5 months ago

It sucked and failed, like most of them.


5 months ago

yeah but I wanna know what it is, I forgor these things


4 months ago

@foo229 - we would be honored if you can give it a try - https://discord.com/channels/713503345364697088/1344913382427332670