On Wed, Jun 17, 2015 at 4:18 PM, Paul Kraus <[email protected]> wrote:

> The link helped but didn't solve my issues. I reduced my threads from 5 to
> 1 with processes not set and that made it go away. To be honest i don't
> understand how processs and threads are used and what there meaning is in
> the  mod-wsgi settings.
>

Processes define how many python instances to start
Threads define how many threads to start inside each python instance (but
as threads in python suffer from the GIL it just provides a way to serve
requests while the I/O is moving forward, so it has no great benefit to set
it higher than 2-3-4-5 threads for each process).


> Does this now mean apache is using i a single process and thread to handle
> all requests? That can't be good. How are these variables used and what are
> the ramifications on how i have them set (processes ommited and threads=1).
>

If threads=1 if means that each process will be able to serve a single
request at time. If you have only 1 process with only 1 thread that means
you can only serve 1 request at time.

Usually setting an high number of processes should not have any issues as
they are totally independent and unrelated python instances, while using
more than 1 thread might actually lead to problems (race conditions,
crashes and so on) if your python code is not thread safe or relies on C
extensions that are not thread safe or do not cope well with the GIL.

In case you have issues with C modules, it might often help to set an high
number of processes and use a single thread for each one of them.
I still suspect that your problems are caused by pyodbc by the way

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to