2 years ago
What contributes to RAM and Egress usage, particularly for a postgres service? We are seeing nearly $5 usage cost for RAM on our postgres service and we only have 1 user. Comparing our usage to the "Growing SaaS" example on Railways website we are using nearly the same RAM and 10x the Egress. How can this possibly be?
1 Replies
2 years ago
A baseline Postgres service on our latest version uses <100MB at rest, with zero data or connections. However, there are many factors that can increase your mem usage, such as cached data and pooled connections regardless of # of users (and that will also depend on how you're pooling the connections, how your ORM is handling it, etc.)
Egress usage is incurred when your database sends data out of Railway, i.e. when you query your database and it sends data back. If your app is in your Railway project, you'll want to connect to the db over private network (using the DATABASE_PRIVATE_URL
variable) to eliminate egress costs. Note that you'll still incur egress costs if you connect to it from outside Railway.
It's hard for us to give you an exact cost estimate because there are many variables involved here, most of them are out of our control and entirely dependent on your code and usage, but I hope that gives you some idea on what could be contributing to your usage costs!