Abnormally Python Fastapi RAM usage
Hi there,
i just started using the railway and its kinda confusing, i deployed a python fastapi server with nothing much on, i mean some endpoints with some ease text manipulations. After 5 minutes of the server was deployed, the ram jumped to 1.42GB and it also shows the date of march 1st 5pm, however if i do check the server page, the ram usage looks normal, its around 55mb. I dont have any other services but the python server.
My questions are:
- why is that ?
- what metric should i take into consideration?
- will i be charged if the ram is so large even if its not possible for my server to use such huge amount?
PS While writing this post, the ram jumped to 1.64GB
31 Replies
Project ID:
80a25fde-5588-4468-a4e8-637e595ab75b
You might find these helpful:
- Is this normal RAM usage for a FastAPI app?
⚠️ experimental feature
80a25fde-5588-4468-a4e8-637e595ab75b
please link discord to railway
done
just tried to run the fastapi template from https://railway.app/template/-NvLj4
after running for 7 minutes it reached 191mb ram from 27mb initial
That's the project usage metrics, what did the service metrics say when that was reading out 191
That's very interesting, we've been having quite a few usage visualization bugs since the visualizations were updated. Tagging in @coffeecup to take a look as they've been handling most of the vis issues
Looks like the account usage view could be cumulative accidentally?
Can you link these please
Meant the free hour bugs. Also had a couple other bugs related to the charts that you were tagged in. Will link if I can find others
it was showing stable 27mb along with the correct date, today's date i mean, on the main it was showing the 1st march instead of the 5th of march, now it shows 20th Jan
its clearly some bugs but i want to know if i can continue using the service without being charged because of this bug
Looks to me like you've just started your service. You'll only be charged for the usage you've actually used, I can guarantee that
No matter the visualization bugs
now the graphic doesnt show more than 27mb of ram used, however if you check the Memory row below the graphic, you can see how the minutely GB is increasing:)
i see, great to hear that, i will continue using it then
I don't see anything increasing
What do you mean by the above?
please see the screenshots i provided earlier, the graph shows the 27mb used but the memory is changing
Still not sure what you mean... Those are the same numbers
Your amount of memory used will increase over time as your application is active
However, the price per GB will not change
so it changed from 1.21 to 1.4 because the time has passed not because the ram used? i dont really get the minutely GB metric
Each minute, Railway will add the average amount of GB of RAM used in that minute to your total. You will be charged based on your RAM usage per minute
If your app used 1GB of ram for a minute, you would be charged for 1GB. If your app used 10MB, you would be charged for 0.010GB
so if i will use one minute 1 gb of ram and another minute 2 gb of ram, i will be charged for 3 gb of ram i used, right?
Yes, you would be charged as if you used 3gb of ram for 1 minute
the important number here is per minute. since you just started your Railway app you won't get an accurate estimate, but once you've had your app active for 48 hours you can check the "usage" section of your account page and you'll be able to see the estimated cost of your app until the end of the month
https://railway.app/account/usage
judging by this photo, i can deduce that my app is using 2 gb of ram per minute?
it seems odd because its the puthon fastapi template container for the railway templates, it basically does nothing but it still uses 2gb lol
No, that number is not the current amount of RAM your app is using. That is the cumulative amount of RAM per minute your app has used
ohh wait, its adding each minute the actual usage of my app
Since your app has started, it has used 2 GB minutes worth of RAM
yep
now i see, thank you for clarifying and sorry it took so long:)
No worries, the pricing can be confusing
Not to mention the new visualization bugs
it would be more intuitively if it was called total ram used or something like that, because the name minutely GB intuitively suggests that your app has used 2 GB of ram per minute:)
I agree, there should be more language to suggest that the value is cumulative rather than point-in-time
anyway, thanks for your help, lets hope the bugs will be resolved soon, have a great day
No problem, glad I could clarify