Huge network egress costs
nick12
HOBBYOP

2 years ago

Hi, I'm getting huge network egress costs and I don't really know why. I'm running a Redis and Postgres server. Here are the settings for my Postgres:

DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'railway', 'USER': 'postgres', 'PASSWORD': os.getenv('PGPASSWORD'), 'HOST': 'postgres.railway.internal', 'PORT': '5432', } }

I figured since I'm using the internal host then I wouldn't get these extra costs but it's not having the desired effect. Any help would be appreciated. Thanks!

Solved

43 Replies

nick12
HOBBYOP

2 years ago

N/A


2 years ago

how is your app connecting to those services?


2 years ago

make sure they are using the private network



nick12
HOBBYOP

2 years ago

Isn't that what this line is doing: 'HOST': 'postgres.railway.internal', ?


maddsua
HOBBY

2 years ago

Which service causes that egress?


2 years ago

Yep, that's it.

If private networking is properly set between your services then you should investigate what is causing this high egress costs, what service uses that much egress?


nick12
HOBBYOP

2 years ago

I've got no idea. I don't really know what egress even is. I just saw it on my bill. I had this problem before and I started using the internal hosts and it solved it. But even using the internal hosts isn't working anymore.


2 years ago

project id please


nick12
HOBBYOP

2 years ago

6d42db87-7a88-4e8b-85fe-1365cf208831


2 years ago

are you connecting to s3?


nick12
HOBBYOP

2 years ago

yeah


2 years ago

uploading to s3 is egress


nick12
HOBBYOP

2 years ago

just uploading?


2 years ago

yes just uploading, egress is outbound traffic


2 years ago

we dont charge for ingress / inbound traffic


nick12
HOBBYOP

2 years ago

the users can upload their images and videos but they don't do it that often


2 years ago

does your app modify the images or videos? or just pass them onto the s3 bucket?


2 years ago

if you just pass the files stright to s3, then you would want to instead be returning a signed url to the users to upload the files to, that will eliminate the egress of you sending the files to s3


nick12
HOBBYOP

2 years ago

It resizes their images but I've just checked and there are only 6 images in the bucket


2 years ago

alright then maybe you are still connecting to postgres and redis publicly


2 years ago

remove both of their public tcp proxies and redeploy both of them, then check if your app still works


nick12
HOBBYOP

2 years ago

do you have a link on how to do that?


2 years ago

1328115322443534447

1328115322737262624


nick12
HOBBYOP

2 years ago

alright, that seems to have worked


nick12
HOBBYOP

2 years ago

I'll just keep an eye on it over the next 24 hours to see if it takes off again


nick12
HOBBYOP

2 years ago

thanks for the help


2 years ago

if you still have egress then it's not egress from the databases, and if so, there won't be much we can help with tbh


2 years ago

you have not removed the tcp proxy from postgres


nick12
HOBBYOP

2 years ago

Alright, yeah, I've just noticed that


nick12
HOBBYOP

2 years ago

it's weird that it keeps on using the public connection


nick12
HOBBYOP

2 years ago

the costs have definitely come down


nick12
HOBBYOP

2 years ago

pretty sure it was the Redis connection that was doing it as that it is updated multiple times a second


2 years ago

hey, how is it going with the egress?


nick12
HOBBYOP

2 years ago

Since the changes were made, it's gone up by 10gb


2 years ago

then that would be genuine traffic, it's not from the database given there's no TCP proxy anymore


nick12
HOBBYOP

2 years ago

Where could that be coming from though?


2 years ago

I'm sorry but I have no way to tell you with any level of certainty, we do not track our users internet usage in such a way that would let me tell you anything other than how much you're using (though of course you can also see that yourself)


nick12
HOBBYOP

2 years ago

I had another look at this today and it's added another 20GB of egress. What else other than database connections can cause this?


nick12
HOBBYOP

2 years ago

I am running Celery and Redis and Celery is making API calls to get additional information. Can this be a cause as well?


2 years ago

any outbound traffic counts as egress


nick12
HOBBYOP

2 years ago

Guess that explains it then


2 years ago

!s


Status changed to Solved brody • over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...