CherryPy for hosting control panel app
For a long time, I wanted to start a project for pets that would aim for the time being to become a web hosting control panel, but mainly focused on Python hosting - what I would like to do is a way for users to generate / run Django / other projects with frames. I thought I found the perfect tool to build my application with it: CherryPy.
This will allow me to do it the way I want by creating an application with my own HTTP / HTTPS server and everything in my favorite programming language.
But now a new question arises: since CherryPy is a multithreaded server, is it right for this kind of task?
There will be a lot of time consuming tasks, so if one of the task blocks, the rest of the users trying to access other pages will remain pending and eventually crash.
I assume this kind of problem will not occur on a fork based server.
What would you suggest?
source to share
Threaded and Forked servers are equivalent. A "multithreaded" server has several threads of execution, and if one of them blocks, the rest will continue. There are several processes running on a fork based server, and if one of them blocks, the rest will continue. The only difference is that by default streaming servers will swap memory between threads, by default "fork based" will not swap memory.
One more point - the subprocess module is not thread safe, so if you try to use it from CherryPy you will get weirder errors. (This is Python Bug 1731717 )
source to share