a year ago
I have a chatbot project - next.js and python (fastapi) that seems to burning through my usage. I have activated serverless mode and yet the app is using more than 800mb of memory literally every second and the server hasn't scaled down. This is costing me money despite zero usage. Please advise.
4 Replies
a year ago
Hello,
Please see our docs on this topic -
https://docs.railway.com/reference/app-sleeping
In short, it's very likely that you have architected your app in a way that won't allow for it to scale to zero.
Best,
Brody
Status changed to Awaiting User Response Railway • 11 months ago
a year ago
Thanks for the super quick response. Just wanted to check if background keep-alive packets from standard database drivers (like motor, redis-py) are sufficient to prevent App Sleeping. I am using MongoDB and Redis, could this be the reason that the app doesnt sleep? Also, would 800+mb of memory usage be normal?
Status changed to Awaiting Railway Response Railway • 11 months ago
a year ago
Yes, standard keep-alive, health checks, or logging packets can keep the connection alive and prevent Serverless.
800MB of memory usage sounds pretty normal, especially for python pooled worker services.
Status changed to Awaiting User Response Railway • 11 months ago
Status changed to Solved echohack • 11 months ago
echohack
Yes, standard keep-alive, health checks, or logging packets can keep the connection alive and prevent Serverless.800MB of memory usage sounds pretty normal, especially for python pooled worker services.
a year ago
Perfect, thank you so much!
Status changed to Awaiting Railway Response Railway • 11 months ago
Status changed to Solved technoobmahajan • 11 months ago