Opened 11 years ago

Last modified 3 years ago

#5180 enhancement new

spawnProcess-based WSGI container

Reported by: Glyph Owned by:
Priority: normal Milestone:
Component: web Keywords:
Cc: jknight, Julian Berman Branch:
Author:

Description (last modified by Glyph)

We should have a WSGI container that supports using processes instead of threads, for utilizing multiple cores. The 'twistd web' command line should allow for use of this as well.

Change History (6)

comment:1 Changed 11 years ago by DefaultCC Plugin

Cc: jknight added

comment:2 Changed 11 years ago by Glyph

Description: modified (diff)

comment:3 Changed 11 years ago by Jean-Paul Calderone

How should it work? Should it share the HTTP port between processes? Via pre-forking? Or sendmsg? Should the main process accept all requests and proxy them to other processes? Should it have child process lifetime limits?

comment:4 in reply to:  3 Changed 11 years ago by Glyph

Replying to exarkun:

How should it work?

Well!

Should it share the HTTP port between processes? Via pre-forking? Or sendmsg?

I believe each of these options is valuable, as they all have different performance characteristics. I'd really like for Twisted to be the end-all be-all of WSGI containers, since one of the main reasons that I hear about people switching between different containers is that they all implement different subsets of these (multithreaded, multiprocess, pre fork, etc).

Not to mention the fact that the infrastructure for each of these would be useful to other multiprocess Twisted applications.

Should the main process accept all requests and proxy them to other processes?

Again, this should be an option. I think that this should be the first option implemented, because although it's not the highest performance, it would allow for other interesting optimizations; for example, hosting static content in the front-end process (which, with a slightly smarter file I/O implementation, could reduce the overhead of handling such a request).

Should it have child process lifetime limits?

If what you mean by this is "should it be able to kill a subprocess where handling a request has gone off the rails", then absolutely.

comment:5 Changed 9 years ago by Julian Berman

Cc: Julian Berman added

comment:6 Changed 3 years ago by Glyph

Owner: Glyph deleted
Note: See TracTickets for help on using tickets.