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!
43 Replies
a year ago
how is your app connecting to those services?
a year ago
make sure they are using the private network
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?
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
a year ago
are you connecting to s3?
a year ago
uploading to s3 is egress
a year ago
yes just uploading, egress is outbound traffic
a year ago
we dont charge for ingress / inbound traffic
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
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
a year ago


I'll just keep an eye on it over the next 24 hours to see if it takes off again
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
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?
a year ago
then that would be genuine traffic, it's not from the database given there's no TCP proxy anymore
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)
I had another look at this today and it's added another 20GB of egress. What else other than database connections can cause this?
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
a year ago
!s
Status changed to Solved brody • about 1 year ago