How to set minimum RAM & CPU for a single instance?
We're relatively a new startup looking forward to trying out Railway. We'd like to run a Flask server in production using Gunicorn with at least 4GB RAM allocated for our works. There seems to be no option to vertically scale in the deployment settings page.
How can we set minimum RAM, CPU? Any guidance would be helpful. Thank you.
17 Replies
Project ID:
da795de3-9cd9-4c8e-88e9-b39a4e8028af
da795de3-9cd9-4c8e-88e9-b39a4e8028af
a minimum RAM and CPU? <:mommy_confused:1023749002069540935>
Do you mean a maximum?
Also railway automatically scales vertically for you, until you reach your plan's resource limits for the service anyway
Two questions here:
1. We are using Heroku at the moment and looking forward to entirely ditching Heroku in favor of Railway, but our services seem to be running at lower memory available (while they're not handling any web requests) than compared to Heroku on a per instance basis. Is there a way we can set minimum memory & CPU below which it doesn't scale down, even if there's not traffic?
So you're saying on railway your app uses less resources and you don't want that?
In Railway each Gunicorn worker is getting less resources, compared to earlier is what I'm trying to say...
So, I'm looking on how to scale it to match the performance of what we already have.
Oh I see what you mean, I'm not really sure if that's possible on railway
I don't have much experience with Gunicorn, or python as a whole either
Best wait for someone more knowledgable to see this thread
So, our service is a Flask based WhatsApp chatbot that recommends people to each other. So, the CPU & RAM usage doesn't directly co-relate to the number of HTTP requests we'll be getting.
As these requests won't be from real people, but rather from WhatsApp webhooks.
So, it may look like we're idling from an HTTP requests standpoint, but the server would be performing internal calculations (running a recommendation engine written in Python + SQLAlchemy).
This engine is running too slow in Railway, when we tried to migrate yesterday night (Indian Standard Time)
the minimum amount of cpu and mem is simply the minimum amount that your app needs, the max is the max your plan allows for.
if your app isnt using 4gb of ram, then it doesnt need 4gb of ram
I totally understand that, what I'm trying to figure out is how Railway determines what is required for my app π
Like does it happen by the number of HTTP requests we're getting?
railway does not determine anything like that for you, you are over thinking this.
your app is fee to use as little or as much of the plans resources it wants at any given time
Because right now, on Heroku we've got 4GB RAM and our Python based recommendation engine is working fine even after it's really far from database's physical location.
In fact, Railway offers the same physical location to our database provider, but still Gunicorn kills the workers threads frequently and the whole performance is really slow.
gunicorns default timeout is 30 seconds
your app is fee to use as little or as much of the plans resources it wants at any given timeAh! I see. That means my app already has 8GB memory if it wants to use right? Then I wonder how come it's slow on Railway being near to the database and faster in Heroku being farther from the database π Yup, we know that could become a problem and we changed it π The command we use right now in both Heroku & Railway is π
That means my app already has 8GB memory if it wants to use right?correct
Then I wonder how come it's slow on Railway being near to the database and faster in Heroku being farther from the databasesorry im not sure, railway runs yout code as is