Skip to content
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

Closed
JASON0916 opened this issue Feb 3, 2016 · 6 comments
Closed

Problem when use gunicorn #13

JASON0916 opened this issue Feb 3, 2016 · 6 comments

Comments

@JASON0916
Copy link

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?

@viniciuschiele
Copy link
Owner

Why are you starting 4 process when you only need one running?

@JASON0916
Copy link
Author

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.
the question is the same as question on StackOverFlow

@JASON0916
Copy link
Author

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.

@JASON0916
Copy link
Author

Sorry for my poor English T^T , if you have good solution please tell me. Thank you honestly!

@viniciuschiele
Copy link
Owner

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.

@JASON0916
Copy link
Author

Ok👌. Thank you for your advice sincerely, that's helpful, also thanks for the flask-apscheduler, that's great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants