-
Notifications
You must be signed in to change notification settings - Fork 85
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
Suggestion: should we revert to Flask dev server? #12
Comments
I was doing some testing of this template, using gevent, flask dev server, gunicorn, and gunicorn with gevent. I was just doing a basic page template. What I found is that flask dev server and gevent are both approximately the same speed. The two servers with gunicorn were about double the speed of the flask dev server. Of course results will vary based on what you are doing. A function with external api calls will do much better with gevent workers. I would suggest that openfaas switch to gunicorn as the default server and make a template both for gunicorn and gunicorn with gevent workers so that users can choose based on their workload. If you want, I could submit a pull request that converts the default template to gunicorn and adds a template that uses gunicorn with gevent. Side note, I believe that this gets rid of the need for the workaround. Also, if people use the gunicorn version, the build time will be faster, but gunicorn with gevent will have the same slow build time. |
Flask dev server is easier to use, but as mentioned in the docs it states that is it not production ready because it doesn't scale well. Could this scaling be resolved by the openfaas auto-scaling functionality? |
I would advise against that. Flask Dev server under load can easily have high latency or even crash. The production alternatives are much more robust. I would use a production server under openfaas rather than the Dev server. Dev stuff in prod is always a bad idea. |
Added the production server waitress |
Werkzeug seems to take a significant amount of time to build and needs work-arounds for chunked-encoding #5 #10
How good is the Flask dev server? Should we do some testing or pre-compile Werkzeug in a base image?
The text was updated successfully, but these errors were encountered: