On Sat, 2016-11-05 at 13:35 -0700, Johan Hartzenberg wrote:
> > > 1 Cherrypy process for all the sites (with thread pool taking
> > advantage of multi core)
> > > or
> >
> > Python thread pools cannot use multiple cores effectively because
> > of the Python GIL
> >
> I have heard this alluded to before. I would like to understand this
> limitation better - where can I read about it and about what can and
> cannot be done about it?
This presentation by David Beazley at the Chicago Python User Group is
quite comprehensive and entertaining (June 2009):
https://www.youtube.com/watch?v=ph374fJqFPE
Threads cannot execute Python code simultaneously, so they're mostly
used to simplify I/O bound concurrent tasks (like handling HTTP
requests). C extensions can release the GIL and take advantage of
multiple cores however, which is where the vagueness of some statements
regarding the GIL comes from (i.e. some modules can take advantage of
multiple cores, some can't).
If your system is CPU-bound, do use one process per core. Using an
application server to do that is a good idea.
-t