Josso Ares
Josso Ares
RRailway
Created by Josso Ares on 9/23/2023 in #✋|help
Share $PORT across services for private networking
I have two services, CMS and Web. CMS listens on :: at port $PORT. Web listens on 0.0.0.0 at port $PORT. CMS needs to be publicly accessible through the Internet (so that Admin and Content Editors can edit content) (hence why it listens at port $PORT), but also privately available through Private Networking (so that Web can make API calls to retrieve content) (hence why it listens at ::). Web needs to know ${{CMS.PORT}} so that it can call http://cms.railway.internal:$${CMS.PORT}/. It seems like this kind of service cross-referencing the $PORT variable doesn't work. Due to a limitation in CMS, I can only listen at one (interface, port) combination, so listening both at (0.0.0.0, ${PORT}) and (::, 1234) wouldn't work (if it did, Iwouldn't need to know the Railway-assigned port, right?). How can I make this work?
35 replies
RRailway
Created by Josso Ares on 9/22/2023 in #✋|help
Accept health check with 204 status code
According to https://docs.railway.app/deploy/healthchecks, "Railway will wait for this endpoint to serve a 200 status code before switching traffic to your new deployment." One of my services returns a 204 (No Content) response and it does not pass the health check. 204 indicates a successful response and some services like Strapi already have health check endpoints that return 204 on success. It would be nice if I didn't have to write my own custom health check endpoint for Railway just because of this quirk. Any response code in the [200, 299] range should be considered successful, or at the very least, both 200 and 204 should be accepted as a healthy response.
9 replies
RRailway
Created by Josso Ares on 9/22/2023 in #✋|help
MySQL vs Postgres for reducing costs
I'm going to start a project using Strapi, which supports both. In my experience using Railway, most of my costs are due to memory usage: both reading and writing is infrequent. My searches for which RDBMS uses less memory turned out to be inconclusive. Has anyone conducted tests to see which one is cheaper on Railway? I accept anecdotal experience as well.
8 replies