what is egress why are my costs going so high
I am using hobby plan of railway for a small django web application suddenly billing started to go higher and higher its egress what is egress? I have chosen 5 dollar plan i cannot pay more than that!
137 Replies
Project ID:
70164d65-198b-405f-b20d-8423b1e71b1e
70164d65-198b-405f-b20d-8423b1e71b1e
egress is a fancy work for outgoing network traffic.
you are likely paying for that because you are connecting to your database over the public network, instead connect to it via the private network, use the private url variable
Any tutorial video for that ?
I am using postgresql
You will have received emails alerting you to change this over the past few months
I have subscribed today
change your database url link to the private networking link. You can find it in your database service’s environment variables
no videos, but there are docs
this shows you the variable you want to use https://docs.railway.app/guides/postgresql#private-networking
this shows you how to use it https://docs.railway.app/guides/variables#referencing-another-services-variable
this shows you where to set it https://docs.railway.app/guides/variables#service-variables
You can also set spending limits if you have a hard cap on what you would like to be charged
I have put spending limits but It will be hit in a few days because of egress
Great, then get rid of your egress charges by following the links above
get rid of your future database egress charges** 🙂
could not translate host name "postgres.railway.internal" to address: Name or service not known
Do i have to put here the host from database variable ?
can you try adding a 3 second sleep to your start command?
Its gunicorn command i dont understand what you mean
But i could add a custom command
If you can tell
Custom start command
how are you currently setting the gunicorn start command?
Its automatically started
I am not using custom start command
you dont have a Procfile or railway.json?
I have
Procfile
send the procfile please
web: gunicorn dostana.wsgi —log-file -
change it to
OperationalError at /
could not translate host name "postgres.railway.internal" to address: Name or service not known
Request Method: GET
Request URL:
Django Version: 5.0.1 Exception Type: OperationalError Exception Value:
could not translate host name "postgres.railway.internal" to address: Name or service not known Exception Location: /opt/venv/lib/python3.11/site-packages/psycopg2/init.py, line 122, in connec
Django Version: 5.0.1 Exception Type: OperationalError Exception Value:
could not translate host name "postgres.railway.internal" to address: Name or service not known Exception Location: /opt/venv/lib/python3.11/site-packages/psycopg2/init.py, line 122, in connec
send build logs please https://bookmarklets.up.railway.app/log-downloader/
Same
Error
What should i do
build logs please
Any tutorial for it ?
Video or document ?
there are 3 steps on the page
i am using firefox
it works with firefox
I am here i bookmarked
That link now what ?
you did not follow the instructions, you bookmarked the web page, please follow the instruction on the page
alright
I got the logs
Should i send it here ?
.log file ?
yes
Here
It is
build logs please
Here
Web is down users are putting pressure on me
screenshot of your railway project please
where is the database?
your database needs to be in the same project as the app that is accessing it, otherwise you will not be able to use the private network to connect to it
I didn’t understand what you mean
Alright
But can I transfer
It ?
Transfer that database inside my project
Because it contains data now
And i don’t wanna now take backup and restore
Inside my project
thats a semi manual process
- create a new database in your
mucho-knot
project
- deploy the Postgres Plugin Migration
template into your mucho-knot
project
- the PLUGIN_URL
variable will be the public url of the database from your workable-trucks
project
- the NEW_URL
will be the url of the new database you just created
- deploy itFrom where
How to get old database plugin url
copy it from the variables tab
By which name
It will be available
please check my steps
Alright
Got it
It would be database url
yep
I will let it deploy the plugin after that is it okay to delete that plugin?
as long as you confirm your data has made it to the new database you deployed in the
mucho-knot
project, then yesWhat about sleep
Command
Should i remove it ?
its still needed
Lets see
Project is building
can you send a new screenshot of the mucho-knot project please
looks good
have you used the migration template yet?
No
I subscribed today
Will i get 0 inges cost now ?
No
I used that plugin
Got data transferred
Alright its working
But too slow
Idk why
are you sure you are using variable references?
Yes its working
No
I mean its working
Posts are showing
People are online
Its connected that’s why it is working
but are you are using variable references for the database url?
Alright now its fine
It has plain data in it
Its alright
My github repo is private
sorry that doesn’t quite answer the question
No just copy pasted private db url
please do not do that, use variable references instead
Why ?
will it work with variable reference?
you never want to hardcode the url variable
Should i use variable like hostname pguser etc
Instead of credentials?
you should use variable references
I used them
I put info correctly
im not sure you did, please read these docs pages
The user hostname password
Speed of website is fine now
im only trying to help you do it the right way
Dude i tried but
I couldn’t understand those
Docs
there is examples to look at
this is a variable reference
I am connecting it by using
Dj celery
Instead of url
Should i put that their ?
This ?
its okay, its works for now, thats all that matters right now
Yes i will learn eventually
But will it affect billing or performance?
By not using those variables?
i dont know if you are using the correct variable, so i cant say, sorry
What about Egrees cost
Will it be 0 ?
it will never be zero, the app itself will always have egress costs since its a web site
But what will be my end bill 5$ ?
I was using a vps before this railway a ubuntu vps it was 6 euro per month fixed cost 4 core 8gb ram and 800gb ssd
i cant say that either, i dont know how much resources your app will use by the end of the month
cost is based on resource usage
What is fixed price ?
Don’t it have a fixed price ?
railway does not have fixed pricing
What is 5$ worth of usage and 5$ base plan price
you pay 5$ for the account, you get $5 towards usage every month, and then you are charged for any resource usage above 5$
Alright lets see where it goes
What about additional storage
Above than 100gb
What are costs
For that
For additional 100gb lets say
you do not want to use the container storage for this (that is referring to the 100gb) for anything but short lived temp files, becuase any files you saved there will be removed on the next deploy, for persistent storage you want to use a volume https://docs.railway.app/guides/volumes
hobby users get a 5gb volume
Alright should i create that too inside
My project?
you would need to create the volume attached to the web service itself
Are their any additional steps for configuring it or it will be utilised automatically
your code would need to save the files to the volume's mount point
In django settings file ?
What if I don’t create a volume
It has 100gb space
then any files you save to disk will be removed on the next deploy
are you saving any files to disk?
Omg
Now i understand
Why pictures of users were not showing
Alright let’s create a volume
because you where saving them to the ephemeral container storage
That container is 100gb ?
Why so big size
Just for temp files
big temp files
Django with volume support
Should i select that ?
nope, thats a template
I am creating volume inside my mucho proj
you need to right click the web service and attach a volume
100gb volume price ?
hobby users can only make 5gb volumes
Can i use external
Storage than ?
Buy from somewhere else
yeah you can use things like cloudflare r2, cloudinary
What would be price of that
that isnt disk storage though
thats something you could need to check cloudflare/cloudinary for
I want to store pictures and videos uploaded by users
Its a social media site basically
then cloudinary is probably your best bet
Cheapest solution
I am not earning any money from site
you would need to check on cloudinary's pricing page
Its just my hobby
Mount path
Of volume should i set
/.
A slash
definitely not, id recommend
/app/media
Its /media folder
Inside my django projext
yes and your app is placed inside of an
/app
folderShould i set
Media folder
Path here ?
/app/media
Alright i am setting
This exact path
What if i want to
Delete data from volume
When it fill up
Volume name is dog-volume 🤣🤣
your code would need to provide a way to delete data from the volume
auto generated
I know
But can i access
Using command line
Like ubuntu vps uses command line
nope thats not how railway works right now, all file access has to be done via the service its attached to
Alright thanks for helping me where can i tell that Brody helped me
And guided me alot
where can i tell that Brody helped me
Alright thanks for helping meyou just did
Alright but they should hire you as a tech support guy
You would be a great fit for it
not qualified, but thank you ❤️
It is truth Your experience in this railway app can help alot of users it will increase railway growth
thank you