Help reducing egress costs, or at least figure out what is the culprit for them.
I am hosting a webpage, front and backend services on railway, and recently ive seen that my Egress costs have ballooned a bit, theyre at about more than 600 GB, and they should not have been as high (considering our scaling). I don't think I should be using as much, but I have no idea where to look to figure out what could be the culprit of the cost.
Btw... im not much on an expert, so please be understanding,
Thanks!
24 Replies
a very common cause of ballooning egress is connecting to the database over the public network instead of the private network
I dont think this is it, since this is the frontend service and it does not connect directly to our mongo database
The backend service does
exactly, does your backend connect to the mongo database via the public network?
And the backend service is not having egress costs
The frontend does
but the database can have egress costs
neither the database nor the backend has any egress costs
there's definitely egress on the database and backend, but nothing to worry about
this is to date, the estimated monthly goes to like 80USD
what kind of frontend?
yep exactly, this is why the one of the frontend worries me
um, its a npm web service
i thought maybe images, but most of the content is coming from another hosted service and images load from there
tech stack?
I mean, im using react and git, then some other services like sentry.io
Im sorry if im not too much of an expert on this
client side rendered app?
yes
it should be
im using hygraph for storing the images, so stuff like that should not be touching railway
and files should be going to AWS S3, not through railway either
does that mean you're returning a signed url?
um, for uploading a file, yes
well I'm not seeing anything that could stand out as causing excess egress, that means it just comes down to, that's what your app has used
hmmmm, weird
Any ideas how I could track how is that egress being used
??
In any case thanks for your help Brody, but i'd love to find a way to at least try to figure stuff out, because right now I just have that egress number to work with, no clue how to know where its coming from
put cloudflare in front of your app would be my go to
??
what's the question marks for
Im not sure what you mean by that π
Isn't cloudflare like a separate hosting service?
Im sorry, as I said im not that much of an expert
cloudflare offers a proxy that you could setup to cache or even block requests