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

4 months ago

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

Solved$10 Bounty

2 Replies

henrikruscon
PROOP

4 months ago

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


henrikruscon
PROOP

4 months ago

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


henrikruscon
PROOP

4 months 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


medim
MODERATOR

4 months ago

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


henrikruscon
PROOP

4 months 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
PROOP

4 months ago

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


medim
MODERATOR

4 months ago

By bind it do you mean the ports?


medim
MODERATOR

4 months ago

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


henrikruscon
PROOP

4 months ago

Getting these errors when doing railway run


henrikruscon
PROOP

4 months ago

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


henrikruscon
PROOP

4 months ago

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


brody
EMPLOYEE

4 months 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
PROOP

4 months ago

Ok splendid, thanks


henrikruscon
PROOP

4 months ago

Shame but I can work around it


noahd
EMPLOYEE

4 months 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.


noahd

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.

brody
EMPLOYEE

4 months ago

DNS is still involved in private networking


medim
MODERATOR

4 months ago

!s


Status changed to Solved medim 4 months ago


Loading...