> Hi, > > The url show that the user process used multiple cores when it worked. In > my case, I cap at 1. > From my understandinf, the process is handled by gevent: > > I was starting with paster server conf.ini > > in conf.ini > > [server:main] > use = > egg:pastegevent#gevent > > > > I tested with pyramid 1.4a3 instead of 1.2. I used pserver and changed the > line to: > > use = egg:waitress#main > > As I read elsewhere that it was supporting multiple threads, but this gave > me an gevent error: > > NotImplementedError: gevent is only usable from a single thread > gevent is only usable from a single thread > > So this mean I need to put my parallelisme at an outer level (nginx?) or > to > modify the app to don't use gevent internally? > > I'm pretty sure it is me missing something, as I'm new to pyramid. >
First of all, ensure the gevent inclusion has been done right. Your database adapters must be gevent friendly as well as all of the others 'blocking' parts of your apps. If a single component is not gevent friendly you can simply remove gevent from the stack as it is useless (and to some extent, dangerous). Now, using threads could be a viable choice for you (if you remove gevent). Generally, webapps tend to be I/O bound, and while doing I/O, the python GIL is released, unleashing your multiple CPU cores. Going multiprocess will be a much better way (from a performance point of view) albeit more 'costly' (1 almost-whole copy of the app for each process). In such a case you will need to use a more advanced application server like gunicorn or uWSGI. I hope it will be useful -- Roberto De Ioris http://unbit.it -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
