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
Percy
Percy2y ago
Project ID: 80a25fde-5588-4468-a4e8-637e595ab75b
Percy
Percy2y ago
You might find these helpful: - Is this normal RAM usage for a FastAPI app?
⚠️ experimental feature
Valmir
Valmir2y ago
80a25fde-5588-4468-a4e8-637e595ab75b
Brody
Brody2y ago
please link discord to railway
Valmir
Valmir2y ago
done
Valmir
Valmir2y ago
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
Brody
Brody2y ago
That's the project usage metrics, what did the service metrics say when that was reading out 191
Adam
Adam2y ago
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?
jr
jr2y ago
Can you link these please
Adam
Adam2y ago
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
Valmir
Valmir2y ago
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
Adam
Adam2y ago
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
Valmir
Valmir2y ago
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:)
Valmir
Valmir2y ago
i see, great to hear that, i will continue using it then
Adam
Adam2y ago
I don't see anything increasing What do you mean by the above?
Valmir
Valmir2y ago
please see the screenshots i provided earlier, the graph shows the 27mb used but the memory is changing
Adam
Adam2y ago
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
Valmir
Valmir2y ago
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
Adam
Adam2y ago
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
Valmir
Valmir2y ago
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?
Adam
Adam2y ago
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
Valmir
Valmir2y ago
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
Adam
Adam2y ago
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
Valmir
Valmir2y ago
ohh wait, its adding each minute the actual usage of my app
Adam
Adam2y ago
Since your app has started, it has used 2 GB minutes worth of RAM yep
Valmir
Valmir2y ago
now i see, thank you for clarifying and sorry it took so long:)
Adam
Adam2y ago
No worries, the pricing can be confusing Not to mention the new visualization bugs
Valmir
Valmir2y ago
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:)
Adam
Adam2y ago
I agree, there should be more language to suggest that the value is cumulative rather than point-in-time
Valmir
Valmir2y ago
anyway, thanks for your help, lets hope the bugs will be resolved soon, have a great day
Adam
Adam2y ago
No problem, glad I could clarify
Want results from more Discord servers?
Add your server