Huge network egress costs
nick12
HOBBYOP

a year 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

a year ago

N/A


a year ago

how is your app connecting to those services?


a year ago

make sure they are using the private network



nick12
HOBBYOP

a year ago

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


maddsua
HOBBY

a year ago

Which service causes that egress?


a year 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

a year 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.


a year ago

project id please


nick12
HOBBYOP

a year ago

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


a year ago

are you connecting to s3?


nick12
HOBBYOP

a year ago

yeah


a year ago

uploading to s3 is egress


nick12
HOBBYOP

a year ago

just uploading?


a year ago

yes just uploading, egress is outbound traffic


a year ago

we dont charge for ingress / inbound traffic


nick12
HOBBYOP

a year ago

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


a year ago

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


a year 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

a year ago

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


a year ago

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


a year ago

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


nick12
HOBBYOP

a year ago

do you have a link on how to do that?


a year ago

1328115322443534300
1328115322737262600


nick12
HOBBYOP

a year ago

alright, that seems to have worked


nick12
HOBBYOP

a year ago

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


nick12
HOBBYOP

a year ago

thanks for the help


a year 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


a year ago

you have not removed the tcp proxy from postgres


nick12
HOBBYOP

a year ago

Alright, yeah, I've just noticed that


nick12
HOBBYOP

a year ago

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


nick12
HOBBYOP

a year ago

the costs have definitely come down


nick12
HOBBYOP

a year ago

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


a year ago

hey, how is it going with the egress?


nick12
HOBBYOP

a year ago

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


a year ago

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


nick12
HOBBYOP

a year ago

Where could that be coming from though?


a year 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

a year 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

a year ago

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


a year ago

any outbound traffic counts as egress


nick12
HOBBYOP

a year ago

Guess that explains it then


a year ago

!s


Status changed to Solved brody about 1 year ago


Loading...