views:

244

answers:

1

For quite a long time I've wanted to start a pet project that will aim in time to become a web hosting control panel, but mainly focused on Python hosting -- meaning I would like to make a way for users to generate/start Django/ other frameworks projects right from the panel. I seemed to have found the perfect tool to build my app with it: CherryPy.

This would allow me to do it the way I want, building the app with its own HTTP/ HTTPS server and also all in my favorite programming language.

But now a new question arises: As CherryPy is a threaded server, will it be the right for this kind of task?

There will be lots of time consuming tasks so if one of the tasks blocks, the rest of the users trying to access other pages will be left waiting and eventually get timed out.

I imagine that this kind of problem wouldn't happen on a fork based server.

What would you advise?

+1  A: 

"Threaded" and "Fork based" servers are equivalent. A "threaded" server has multiple threads of execution, and if one blocks then the others will continue. A "Fork based" server has multiple processes executing, and if one blocks then the others will continue. The only difference is that threaded servers by default will share memory between the threads, "fork based" ones by default will not share memory.

One other point - the "subprocess" module is not thread safe, so if you try to use it from CherryPy you will get wierd errors. (This is Python Bug 1731717)

user9876