Egress usage

6 months ago

I have been observing that egress usage has increased in the last week. But I am not getting many requests. I want to find out the reason for this. I have deployed too many databases in the last week, could this be the reason?

Solved

26 Replies

6 months ago

For my application that has never received any requests, the Estimated Bill is $1073.39. It looks like this. It doesn't seem normal. And it scares me. I would be glad if you could help me.


6 months ago

I wonder what consumes so much egress?

Attachments


6 months ago

You are using the public network to connect to your database, and thus you are subjecting yourself to needless egress fees.

Please check out our best practices page -

https://docs.railway.com/overview/best-practices#use-private-networking-when-possible


Status changed to Awaiting User Response railway[bot] 6 months ago


6 months ago

I will try what you suggested, but I feel like there’s another issue. There seems to have been an increase after November 24, and I believe it’s due to my backend code, but when I review my backend code, I don’t see any significant changes. I rolled back to the deployment from November 24 and am currently testing it. Additionally, when I run my backend locally, I don’t encounter this issue, even though it’s connected to the same database; it behaves very differently. I haven’t been able to figure this out.

Attachments


Status changed to Awaiting Railway Response railway[bot] 6 months ago


6 months ago

The application is simply using more egress now, we have no way to tell you why its using what it is, similarly to how your power company can tell you how much power you are using, but they can't tell you what you are doing to use the power they bill you for.


Status changed to Awaiting User Response railway[bot] 6 months ago


6 months ago

Unfortunately, under these circumstances, I cannot make my application operational. I redeployed my November 21 deployment, but nothing changed. Encountering such an issue out of nowhere deeply upset me. I urgently need help with this. I’m sharing the results of the November 21 deployment, and there’s no difference. My backend application is pulling 350MB of data per minute from my PostgreSQL database for no apparent reason, and I don’t know why. On November 21, it wasn’t pulling this data, and I can’t figure out the cause. When I test it locally, it doesn’t pull this data. I believe this issue is related to Railway.


Status changed to Awaiting Railway Response railway[bot] 6 months ago


6 months ago

I forgot to include the screenshots.

Attachments


6 months ago

This is not an issue related to Railway.

Do you have the database in the same project yet?


Status changed to Awaiting User Response railway[bot] 6 months ago


6 months ago

Yes, I have a database and a backend created with Java in the same project. These are connected to each other and Egress consumption has increased in the last 15 days. I did not make any changes to the backend code. This happened out of the blue. In fact, I redeployed my deployment dated November 21 to test this but the result did not change. It seems that there is an egress consumption of 350MB per minute. Also, when I connect my backend to the same database you host and run it locally, it does not use egress, it uses very little, 10 - 13kb. I do not think the problem here is caused by the backend. I will continue to research anyway. I thought you at least had an idea about this. I need to solve it urgently, otherwise I cannot use it this way because I cannot pay thousands of dollars in bills, my application is small and does not receive any requests.


Status changed to Awaiting Railway Response railway[bot] 6 months ago


6 months ago

I had a look at your project and the database is not in the same project, can you share why you said it was?

As long as you have the database and app in separate projects you will continue to see egress.

Please check out the docs page I had previously linked -

https://docs.railway.com/overview/best-practices


Status changed to Awaiting User Response railway[bot] 6 months ago


6 months ago

I will try my deployment in July for the last time. If the egress consumption is high again, I will throw it into the same project. I will try what you said.


Status changed to Awaiting Railway Response railway[bot] 6 months ago


Status changed to Solved angelo 6 months ago


Status changed to Awaiting Railway Response vacbid 6 months ago


6 months ago

I re-ran the July deploy but nothing changed. Again, egress consumption is high. Now I will try what you said and include both the backend and the database in the same project.

Attachments


6 months ago

Yes, it's very likely that the cross communication between the different projects are causing the costs, regardless of usage.


Status changed to Awaiting User Response railway[bot] 6 months ago


6 months ago

I moved it to the same project but the egress consumption is still the same unfortunately I have to stop it in order not to exceed my budget.

Attachments


Status changed to Awaiting Railway Response railway[bot] 6 months ago


Status changed to In Progress angelo 6 months ago


6 months ago

You need to be using the private network, please read the doc that I linked -

https://docs.railway.com/overview/best-practices#use-private-networking-when-possible


6 months ago

I add variables. I'm testing it and I'll share the results with you.

Attachments


6 months ago

Unfortunately, it has not been fixed. Am I doing something wrong? It is still consuming a high amount of egress.


6 months ago

Unfortunately, I had to shut down all my services. I don't have enough budget for such a high expense. I think there is a problem with the backend. There is no problem locally, but the backend is constantly pulling 350mb of data from the database. When I run it locally and connect to the database you host, there is no problem. However, when I host it with you, it pulls 350mb of data per minute. I can't understand what is causing this. It also suddenly consumes 2.5 gb of memory. I need to test this for a long time, but I don't have the budget to cover it.

Attachments


6 months ago

You where still very likely using the public network for communications.

Traffic on the private network has zero egress fees.


6 months ago

Do I need to change the following values in the application.properties file?

spring.datasource.url=jdbc:postgresql://monorail.proxy.rlwy.net:56066/railway
spring.datasource.username=...
spring.datasource.password=...

6 months ago

spring.datasource.url=jdbc:postgres://postgres:********@postgres.railway.internal:5432/railway
I tried as above but it didn't work. I couldn't find a full explanation for spring in the documentation.

6 months ago

You need to be using environment variables, please do not hard-code the database URL.


brody

You need to be using environment variables, please do not hard-code the database URL.

6 months ago

Should it like this.

spring.datasource.url=jdbc:${DATABASE_PRIVATE_URL}

6 months ago

I'm not familiar with the needed syntax, sorry.


6 months ago

Thanks. Again, I used the railway private network urls and reduced the egress usage to 10kb. You can mark the topic as solved.


6 months ago

Awsome!


Status changed to Solved brody 6 months ago