Egress usage has sky-rocketed
nick12
HOBBYOP

2 years ago

I deleted my postgress database a week ago and reinstalled it only to find yesterday that the egress usage had gone from almost nothing to $18.

I have since deleted the database and reinstalled it again and now it's gone down to around a third of that. Any idea how to get it back to almost nothing again? I have no idea what has caused it to jump.

22 Replies

2 years ago

are you connecting to it over the public network?


nick12
HOBBYOP

2 years ago

The database and the web app are both in the same project on Railway


nick12
HOBBYOP

2 years ago

I'm just connecting to the db with the DATABASE_URL var


2 years ago

you are using the public network then, thus you are subjecting yourself to egress fees


2 years ago

connect to the database via the private network, there is no network costs for service to service communication over the private network


nick12
HOBBYOP

2 years ago

this one: DATABASE_PRIVATE_URL?


2 years ago

correct


nick12
HOBBYOP

2 years ago

I tried using that var but it didn't work


2 years ago

please provide error messages


nick12
HOBBYOP

2 years ago

hang on, let me have another go


nick12
HOBBYOP

2 years ago

Just keep getting this:


nick12
HOBBYOP

2 years ago

django.db.utils.OperationalError: could not translate host name "postgres.railway.internal" to address: Name or service not known


2 years ago

does your service in question have a volume?


nick12
HOBBYOP

2 years ago

yeah, it's got one


2 years ago

then you will need to prefix the start command with a 3 second sleep


nick12
HOBBYOP

2 years ago

python manage.py migrate && python manage.py collectstatic --no-input && gunicorn jobsite.wsgi


nick12
HOBBYOP

2 years ago

how can I change this?


2 years ago

sleep 3; python manage.py migrate && python manage.py collectstatic --no-input && gunicorn jobsite.wsgi


nick12
HOBBYOP

2 years ago

Alright, that's got it working, thanks!


2 years ago

no problem!


nick12
HOBBYOP

2 years ago

I'll just have to keep an eye on the costs and see if they come back down now


2 years ago

there is no network costs for service to service communication over the private network, so if your egress costs go up, it's something else


Welcome!

Sign in to your Railway account to join the conversation.

Loading...