Is using the private network URL faster than the public one?

henrikruscon
PRO

24 days ago

As the title reads. Wondering if there's a speed difference.

Solved$10 Bounty

2 Replies

henrikruscon
PRO

24 days ago

22d2217f-5502-4174-951e-7e64cbde52d2


henrikruscon
PRO

24 days ago

In this particular question I was wondering mainly for things such as Redis and PostgreSQL


henrikruscon
PRO

24 days ago

When changing to using the private URL instead of the public, it appears to solve my bottleneck issues from scaling (large userbase). But it would be neat to get this fact confirmed as well


24 days ago

Yeah, services using the private network will have reduced latency.


henrikruscon
PRO

24 days ago

Getting

php_network_getaddresses: getaddrinfo for redis.railway.internal failed: nodename nor servname provided, or not known

and

SQLSTATE[08006] [7] could not translate host name "postgres.railway.internal" to address: nodename nor servname provided, or not known (Connection: pgsql, SQL: select "email", "id" from "licenses" where "email"::text ilike %w%)

from using the private network URL's in my Laravel project. Any ideas how to approach this?


henrikruscon
PRO

24 days ago

Maybe I should create a separate issues for this, guessing I somehow have to bind it?


24 days ago

By bind it do you mean the ports?


24 days ago

If so, yes you need to bind the port as according to the private networking docs


henrikruscon
PRO

24 days ago

Getting these errors when doing railway run


henrikruscon
PRO

24 days ago

Did bind using php artisan serve --host "[::]" --port $PORT, still getting the errors


henrikruscon
PRO

24 days ago

Is there something special with the railway run environment that could be causing this?


24 days ago

railway run runs the given command locally, and you cannot connect to the private network from outside of the Railway environment as is.

For local development only, you would need to connect to the database over the public network.


henrikruscon
PRO

24 days ago

Ok splendid, thanks


henrikruscon
PRO

24 days ago

Shame but I can work around it


24 days ago

For the private network speed vs public yes private will be faster.
Its making a localhost connection vs making an over network, through dns, and resolving to container.
Not saying that the over network is entirely slow but its slower in comparison.

As for that bug I'm not quite sure about it.


error

For the private network speed vs public yes private will be faster. Its making a localhost connection vs making an over network, through dns, and resolving to container. Not saying that the over network is entirely slow but its slower in comparison. As for that bug I'm not quite sure about it.

24 days ago

DNS is still involved in private networking


21 days ago

!s


Status changed to Solved medim 21 days ago


Is using the private network URL faster than the public one? - Railway Help Station