9 months ago
Hi,
I've tested the communication between 2 services (from GitHub repo) and it seems that communication via external networking (via public address) is slightly faster (up to 0.7s per request) than the internal networking (via RAILWAY_PRIVATE_DOMAIN). I'm aware that using external networking adds network egress cost as mentioned in pricing docs.
Is there any hint why external networking communication is slightly faster than internal networking communication?
8 Replies
9 months ago
Hi,
Could you share details on how you tested this ? what region the services were running in, what payload was being used for testing, language/framework/etc ?
Best,
Nico
Status changed to Awaiting User Response railway[bot] • 9 months ago
9 months ago
Hi,
We're running in Southeast Asia (Singapore) and using a REST API to communicate with a language model through our teaching module. We're using Next.js (Typescript) for this project and run in node:20-alpine
Docker.
We test the same code on Railway, but with different network setups: private IPv6 for internal testing and public URI for external testing. We measure the time it takes from when a user submits input until they receive a reply. Since the rendering and overall process are the same, we track OpenAI's response time in our database and subtract it to find the time spent on rendering, computing, and communication between the main-module and teaching-module. The database is reset after each test, so our results are consistent.
Status changed to Awaiting Railway Response railway[bot] • 9 months ago
9 months ago
Thanks for the update.
I've asked the team to take a look to make sure, but private networking shouldn't be slower than public. I'll keep you updated if anything comes up
Status changed to Awaiting User Response railway[bot] • 9 months ago
9 months ago
Thanks! Looking forward to hear back from you.
Status changed to Awaiting Railway Response railway[bot] • 9 months ago
9 months ago
Our team was unable to find any noticeable difference in the performance of private vs public networking. Unfortunately, your test case contains too many external factors to properly identify any real difference in performance.
Status changed to Awaiting User Response railway[bot] • 9 months ago
9 months ago
If that's the case, is there any performance benchmark made by Railway team? I would like to make it as a reference to further test the issue on our side.
Status changed to Awaiting Railway Response railway[bot] • 9 months ago
9 months ago
We've tested projects with different databases by opening connections and pinging to the databases and found private networking to be faster. Please feel free to update this thread if you're able to successfully investigate and resolve the issue on your end!
Status changed to Awaiting User Response railway[bot] • 9 months ago
9 months ago
Looking into your project a bit more, we think the bottleneck here is likely DNS. Could you switch to a non-Alpine container setup and test again to see if that improves things?