nginx server for flask on Railway???
Hi. I wanted to add a nginx server for load balancing for my python flask template app on Railway.
https://github.com/ryanenoch/flask
I tried looking for answers on YouTube but most of the tutorials used the local Windows or Ubuntu Linux environment.
Can anyone point me in the right direction? Thanks in advance
GitHub
GitHub - ryanenoch/flask: Flask template for Railway deployment
Flask template for Railway deployment. Contribute to ryanenoch/flask development by creating an account on GitHub.
15 Replies
Project ID:
N/A
@Percy N/A
railway has replicas now, theres no need to do this yourself anymore
then again, why do you think you need load balancing??
Replicas? What's that?
id be interested in hearing the answer for this before we get into replicas
I actually wanted to make sure that my other web apps can handle the heavy traffic in the future that's why I was looking into load balancing
fair
1. write efficient code
2. read the docs for railways replica functionality
https://docs.railway.app/develop/services#horizontal-scaling-with-replicas
Thanks Brody
Just one more question (pls forgive me for my noobieness😅)
What is the max traffic limit for a web app using replicas? Is it dependent on our Railway subscription plan?
you can set a max of 20 replicas, but your code is the determining factor on how much web traffic it can handle
Alright thanks again Brody
and keep in mind, lets say your app uses a stable 1$ a month without any replicas, and you add 20 replicas, that will cost you 20$, since 1$ x 20 = 20$
Wow. Never thought of that 😅
yeah but ideally if you have enough incoming traffic to warrant 20 replicas you have setup a way to generate revenue, so that you can afford a seat on the teams plan and your resource costs
Thanks again @Brody
I ll look into it
sounds good