R
Railway11mo ago
Kriim

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
Percy
Percy11mo ago
Project ID: 70164d65-198b-405f-b20d-8423b1e71b1e
Kriim
KriimOP11mo ago
70164d65-198b-405f-b20d-8423b1e71b1e
Kriim
KriimOP11mo ago
No description
Brody
Brody11mo ago
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
Kriim
KriimOP11mo ago
Any tutorial video for that ? I am using postgresql
Adam
Adam11mo ago
You will have received emails alerting you to change this over the past few months
Kriim
KriimOP11mo ago
I have subscribed today
Adam
Adam11mo ago
change your database url link to the private networking link. You can find it in your database service’s environment variables
Brody
Brody11mo ago
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
Adam
Adam11mo ago
You can also set spending limits if you have a hard cap on what you would like to be charged
Kriim
KriimOP11mo ago
I have put spending limits but It will be hit in a few days because of egress
Adam
Adam11mo ago
Great, then get rid of your egress charges by following the links above
Brody
Brody11mo ago
get rid of your future database egress charges** 🙂
Kriim
KriimOP11mo ago
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 ?
Brody
Brody11mo ago
can you try adding a 3 second sleep to your start command?
Kriim
KriimOP11mo ago
Its gunicorn command i dont understand what you mean But i could add a custom command If you can tell Custom start command
Brody
Brody11mo ago
how are you currently setting the gunicorn start command?
Kriim
KriimOP11mo ago
Its automatically started I am not using custom start command
Brody
Brody11mo ago
you dont have a Procfile or railway.json?
Kriim
KriimOP11mo ago
I have Procfile
Brody
Brody11mo ago
send the procfile please
Kriim
KriimOP11mo ago
web: gunicorn dostana.wsgi —log-file -
Brody
Brody11mo ago
change it to
web: sleep 3 && gunicorn dostana.wsgi —log-file -
web: sleep 3 && gunicorn dostana.wsgi —log-file -
Kriim
KriimOP11mo ago
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
Kriim
KriimOP11mo ago
Same Error What should i do
Brody
Brody11mo ago
build logs please
Kriim
KriimOP11mo ago
Any tutorial for it ? Video or document ?
Brody
Brody11mo ago
there are 3 steps on the page
Kriim
KriimOP11mo ago
i am using firefox
Brody
Brody11mo ago
it works with firefox
Kriim
KriimOP11mo ago
No description
Kriim
KriimOP11mo ago
I am here i bookmarked That link now what ?
Brody
Brody11mo ago
you did not follow the instructions, you bookmarked the web page, please follow the instruction on the page
Kriim
KriimOP11mo ago
alright I got the logs Should i send it here ? .log file ?
Brody
Brody11mo ago
yes
Kriim
KriimOP11mo ago
Here It is
Brody
Brody11mo ago
build logs please
Kriim
KriimOP11mo ago
Here Web is down users are putting pressure on me
Brody
Brody11mo ago
screenshot of your railway project please
Kriim
KriimOP11mo ago
No description
Brody
Brody11mo ago
where is the database?
Kriim
KriimOP11mo ago
No description
Kriim
KriimOP11mo ago
No description
Brody
Brody11mo ago
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
Kriim
KriimOP11mo ago
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
Brody
Brody11mo ago
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 it
Kriim
KriimOP11mo ago
From where How to get old database plugin url
Brody
Brody11mo ago
copy it from the variables tab
Kriim
KriimOP11mo ago
By which name It will be available
Brody
Brody11mo ago
please check my steps
Kriim
KriimOP11mo ago
No description
Kriim
KriimOP11mo ago
Alright Got it It would be database url
Brody
Brody11mo ago
yep
Kriim
KriimOP11mo ago
I will let it deploy the plugin after that is it okay to delete that plugin?
Brody
Brody11mo ago
as long as you confirm your data has made it to the new database you deployed in the mucho-knot project, then yes
Kriim
KriimOP11mo ago
What about sleep Command Should i remove it ?
Brody
Brody11mo ago
its still needed
Kriim
KriimOP11mo ago
Lets see Project is building
Brody
Brody11mo ago
can you send a new screenshot of the mucho-knot project please
Kriim
KriimOP11mo ago
No description
Brody
Brody11mo ago
looks good have you used the migration template yet?
Kriim
KriimOP11mo ago
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
Brody
Brody11mo ago
are you sure you are using variable references?
Kriim
KriimOP11mo ago
Yes its working No I mean its working Posts are showing People are online Its connected that’s why it is working
Brody
Brody11mo ago
but are you are using variable references for the database url?
Kriim
KriimOP11mo ago
Alright now its fine It has plain data in it Its alright My github repo is private
Brody
Brody11mo ago
sorry that doesn’t quite answer the question
Kriim
KriimOP11mo ago
No just copy pasted private db url
Brody
Brody11mo ago
please do not do that, use variable references instead
Kriim
KriimOP11mo ago
Why ? will it work with variable reference?
Brody
Brody11mo ago
you never want to hardcode the url variable
Kriim
KriimOP11mo ago
Should i use variable like hostname pguser etc Instead of credentials?
Brody
Brody11mo ago
you should use variable references
Kriim
KriimOP11mo ago
I used them I put info correctly
Brody
Brody11mo ago
im not sure you did, please read these docs pages
Kriim
KriimOP11mo ago
The user hostname password Speed of website is fine now
Brody
Brody11mo ago
im only trying to help you do it the right way
Kriim
KriimOP11mo ago
Dude i tried but I couldn’t understand those Docs
Brody
Brody11mo ago
there is examples to look at this is a variable reference
DATABASE_URL=${{Postgres.DATABASE_PRIVATE_URL}}
DATABASE_URL=${{Postgres.DATABASE_PRIVATE_URL}}
Kriim
KriimOP11mo ago
I am connecting it by using Dj celery Instead of url Should i put that their ? This ?
Brody
Brody11mo ago
its okay, its works for now, thats all that matters right now
Kriim
KriimOP11mo ago
Yes i will learn eventually But will it affect billing or performance? By not using those variables?
Brody
Brody11mo ago
i dont know if you are using the correct variable, so i cant say, sorry
Kriim
KriimOP11mo ago
What about Egrees cost Will it be 0 ?
Brody
Brody11mo ago
it will never be zero, the app itself will always have egress costs since its a web site
Kriim
KriimOP11mo ago
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
Brody
Brody11mo ago
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
Kriim
KriimOP11mo ago
What is fixed price ? Don’t it have a fixed price ?
Brody
Brody11mo ago
railway does not have fixed pricing
Kriim
KriimOP11mo ago
What is 5$ worth of usage and 5$ base plan price
Brody
Brody11mo ago
you pay 5$ for the account, you get $5 towards usage every month, and then you are charged for any resource usage above 5$
Kriim
KriimOP11mo ago
Alright lets see where it goes What about additional storage Above than 100gb What are costs For that For additional 100gb lets say
Brody
Brody11mo ago
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
Kriim
KriimOP11mo ago
Alright should i create that too inside My project?
Brody
Brody11mo ago
you would need to create the volume attached to the web service itself
Kriim
KriimOP11mo ago
Are their any additional steps for configuring it or it will be utilised automatically
Brody
Brody11mo ago
your code would need to save the files to the volume's mount point
Kriim
KriimOP11mo ago
In django settings file ? What if I don’t create a volume It has 100gb space
Brody
Brody11mo ago
then any files you save to disk will be removed on the next deploy are you saving any files to disk?
Kriim
KriimOP11mo ago
Omg Now i understand Why pictures of users were not showing Alright let’s create a volume
Brody
Brody11mo ago
because you where saving them to the ephemeral container storage
Kriim
KriimOP11mo ago
That container is 100gb ? Why so big size Just for temp files
Brody
Brody11mo ago
big temp files
Kriim
KriimOP11mo ago
No description
Kriim
KriimOP11mo ago
Django with volume support Should i select that ?
Brody
Brody11mo ago
nope, thats a template
Kriim
KriimOP11mo ago
I am creating volume inside my mucho proj
Brody
Brody11mo ago
you need to right click the web service and attach a volume
Kriim
KriimOP11mo ago
100gb volume price ?
Brody
Brody11mo ago
hobby users can only make 5gb volumes
Kriim
KriimOP11mo ago
Can i use external Storage than ? Buy from somewhere else
Brody
Brody11mo ago
yeah you can use things like cloudflare r2, cloudinary
Kriim
KriimOP11mo ago
What would be price of that
Brody
Brody11mo ago
that isnt disk storage though thats something you could need to check cloudflare/cloudinary for
Kriim
KriimOP11mo ago
I want to store pictures and videos uploaded by users Its a social media site basically
Brody
Brody11mo ago
then cloudinary is probably your best bet
Kriim
KriimOP11mo ago
Cheapest solution I am not earning any money from site
Brody
Brody11mo ago
you would need to check on cloudinary's pricing page
Kriim
KriimOP11mo ago
Its just my hobby Mount path Of volume should i set /. A slash
Brody
Brody11mo ago
definitely not, id recommend /app/media
Kriim
KriimOP11mo ago
Its /media folder Inside my django projext
Brody
Brody11mo ago
yes and your app is placed inside of an /app folder
Kriim
KriimOP11mo ago
Should i set Media folder Path here ?
Brody
Brody11mo ago
/app/media
Kriim
KriimOP11mo ago
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 🤣🤣
Brody
Brody11mo ago
your code would need to provide a way to delete data from the volume auto generated
Kriim
KriimOP11mo ago
I know But can i access Using command line Like ubuntu vps uses command line
Brody
Brody11mo ago
nope thats not how railway works right now, all file access has to be done via the service its attached to
Kriim
KriimOP11mo ago
Alright thanks for helping me where can i tell that Brody helped me And guided me alot
Brody
Brody11mo ago
where can i tell that Brody helped me
Alright thanks for helping me
you just did
Kriim
KriimOP11mo ago
Alright but they should hire you as a tech support guy You would be a great fit for it
Brody
Brody11mo ago
not qualified, but thank you ❤️
Kriim
KriimOP11mo ago
It is truth Your experience in this railway app can help alot of users it will increase railway growth
Brody
Brody11mo ago
thank you
Want results from more Discord servers?
Add your server