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


I'll just keep an eye on it over the next 24 hours to see if it takes off again
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
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?
2 years ago
then that would be genuine traffic, it's not from the database given there's no TCP proxy anymore
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)
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?
2 years ago
any outbound traffic counts as egress
2 years ago
!s
Status changed to Solved brody • over 1 year ago