-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem when use gunicorn #13
Comments
Why are you starting 4 process when you only need one running? |
Eh, it's my fault. I didn't make the problem clear enough. I suppose there are 4 process working, apscheduler and flask work in the same process(the specific one of four process) and the other three are pure flask process. |
Now my partner and i try to solve this problem by using 4 process running flask application and 1 process running flask and apscheduler to manage the period task of flask application. |
Sorry for my poor English T^T , if you have good solution please tell me. Thank you honestly! |
The only reason I see to spawn more process is because your Flask app is growing, so I do recommend to split up your project, one only for scheduling and another one for the Flask app. Another solution would be running one process for the Flask APScheduler using one port (e.g 5001) and running 4 process for the Flask App using another port (e.g 5000), it seems you are trying to do it. |
Ok👌. Thank you for your advice sincerely, that's helpful, also thanks for the flask-apscheduler, that's great. |
I tried to start 4 process by using
gunicorn -w 4 -b 0.0.0.0:5000 test:app
, and there are 4 flask apscheduler bound to 4 app respectively which will lead to confliction. I only need one scheduler to work. I tried to use the method to bind a socket, but i can't apply for a port in my company, is there any way else to solve that problem?The text was updated successfully, but these errors were encountered: