R
Railway6mo ago
Iceman

Egress usage has sky-rocketed

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.
Solution:
are you connecting to it over the public network? if so, you should use the private network.
Jump to solution
18 Replies
Percy
Percy6mo ago
Project ID: N/A
Solution
Brody
Brody6mo ago
are you connecting to it over the public network? if so, you should use the private network.
Iceman
IcemanOP6mo ago
The database and the web app are both in the same project on Railway I'm just connecting to the db with the DATABASE_URL var
Brody
Brody6mo ago
you are using the public network then, thus you are subjecting yourself to egress fees connect to the database via the private network, there is no network costs for service to service communication over the private network
Iceman
IcemanOP6mo ago
this one: DATABASE_PRIVATE_URL?
Brody
Brody6mo ago
correct
Iceman
IcemanOP6mo ago
I tried using that var but it didn't work
Brody
Brody6mo ago
please provide error messages
Iceman
IcemanOP6mo ago
hang on, let me have another go Just keep getting this: django.db.utils.OperationalError: could not translate host name "postgres.railway.internal" to address: Name or service not known
Brody
Brody6mo ago
does your service in question have a volume?
Iceman
IcemanOP6mo ago
yeah, it's got one
Brody
Brody6mo ago
then you will need to prefix the start command with a 3 second sleep
Iceman
IcemanOP6mo ago
python manage.py migrate && python manage.py collectstatic --no-input && gunicorn jobsite.wsgi how can I change this?
Brody
Brody6mo ago
sleep 3; python manage.py migrate && python manage.py collectstatic --no-input && gunicorn jobsite.wsgi
sleep 3; python manage.py migrate && python manage.py collectstatic --no-input && gunicorn jobsite.wsgi
Iceman
IcemanOP6mo ago
Alright, that's got it working, thanks!
Brody
Brody6mo ago
no problem!
Iceman
IcemanOP6mo ago
I'll just have to keep an eye on the costs and see if they come back down now
Brody
Brody6mo 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
Want results from more Discord servers?
Add your server