danielflower / app-runner

Self-hosted platform as a service for Java, Node, Clojure, Scala, DotNet, Python and golang apps. Push to a git repo to deploy apps.
MIT License
70 stars 44 forks source link

Can I use wsgi server in python web apps? #25

Closed JackKCWong closed 3 years ago

JackKCWong commented 3 years ago

For python web apps it is usually run behind a wsgi server like gunicorn which uses child processes to serve concurrent requests. But the python sample app seems to suggest not to use child processes in app runner. Or is this just peculiar to Flask?

#Set debug=False and threaded=True to prevent Flask forking a child process that doesn't get shut down
JackKCWong commented 3 years ago

It seems there is no way to kill a process tree in java 8, which has been fixed in java 9 with ProcessHandle Is it moving to java 9 or better anytime soon?

danielflower commented 3 years ago

I don't know enough about Python to answer your first question sorry. As for the second, yeah I'm considering moving to Java 11.

JackKCWong commented 3 years ago

thanks. java 11 sounds good. python is a bit special that even multi threading can only utilize one cpu. So production-ready web apps are usually running behind a wsgi server, which is something like the java servelet container for java web app. I will check again when we are on java 11 to see if/how apprunner should support this. :)