-
Notifications
You must be signed in to change notification settings - Fork 250
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
Fix Flask services' performance issues on Windows #1134
Conversation
Some general notes/thoughts. I guess that "gthreads" means "green-threads"? Which means that those threads would be scheduled cooperatively and running on one process (due to Going with orchest/lib/python/orchest-internals/_orchest/internals/utils.py Lines 325 to 329 in bf99fac
EDIT: To answer my own question. I guess "gthreads" means "gunicorn-threads" (aka their own implementation). From the source code we can see that they are using Which would mean that the threads are scheduled preemptively by the OS. I think it would be good to test what happens when a large |
I guess we want to update the auth server as well, for consistency? |
I'm getting
I have tried pinning the following for the webserver, didn't work
|
Co-authored-by: Yannick Perrenet <26223174+yannickperrenet@users.noreply.github.com>
Moved to Flask-SocketIO==5.2.0 (and updated JS socket.io client to 4.5.1 to support the new socket.io protocol required by Flask-SocketIO 5.X). |
We no longer use `eventlet` but still require the patched implementation for gunicorn's `gthread`.
Did some testing and everything seemed to work fine. The testing that I did:
Everything worked smoothly. |
Probably something went wrong during the `script/build_container.sh` that didn't clean up the `orchest-cli` in the first place.
To allow for easier alphabetical sorting of the lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I don't own a Windows machine so I trust that everything works 😉 Glad that everything still works fine on Linux as well. (Should we also run a round of tests on macOS?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, did some testing as well and things worked smoothly, some testing on mac wouldn't hurt given that performance is sometimes an issue on docker on desktop etc.
Did some basic testing on macOS Monterey 12.4.
No hiccups from what I could see. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not Python guru, but LGTM. 👍
Description
Using
eventlet
caused performance issues when running Orchest on Windows usingminikube
and when using the Docker for Desktop included Kubernetes cluster.According to Flask SocketIO they recommend the
gthreads
+simple-web-socket
deployment configuration when using Gunicorn if you don't want to rely on the functioning of green threads.https://flask-socketio.readthedocs.io/en/latest/deployment.html?highlight=threads#gunicorn-web-server
@fruttasecca will probably need to some more testing, but so far the performance has been rock solid with this configuration for me.
Closes: #681, #235
Checklist
dev
instead ofmaster
.requirements.in
I have runpip-compile
to update the correspondingrequirements.txt
.