On Nov 2, 10:47 pm, "Cooke, Mark" <[email protected]> wrote:
> > > > So you never looked at the following?
>
> > > > http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac
>
> > > I looked there, but the only relevant thing I found concerning
> > > multiple instances of Trac was to run all of the instances in one
> > > python interpreter. But to tell the truth I didn't have enough
> > > time to read modwsgi wiki in depth :(
>
> > Huh, it actually talks about it being preferable to use daemon mode
> > and run different Trac instances in their own process groups for
> > various reasons. That is, the opposite of what you are talking about.
>
> As a noob at configuring web / apache processes, I think I may have
> mis-understood something here. Is the wsgi daemon mode different from the
> WSGIApplicationGroup?
Yes they are different.
Only Apache 2.X on UNIX supports daemon mode. In daemon mode it can
run like fastcgi solutions where the actual application runs in a
distinct set of processes separate from the main Apache server child
processes. Because the implementation depends on fork, it cannot work
on Windows.
Configuration of daemon mode is affected by use of the
WSGIDaemonProcess and WSGIProcessGroup directives. See:
http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide#Delegation_To_Daemon_Process
The WSGIApplicationGroup directive, rather than control in which
process an application runs, controls which named Python sub
interpreter within those processes it runs.
That is, within a single process one can have multiple sub
interpreters with different web applications running in each. This
provides a level of separation between the applications so they cant
interfere with each other. Because of limitations in Python this isn't
perfect, but in most cases good enough. By default mod_wsgi will
ensure that each WSGI application specified by WSGIScriptAlias is run
in its own sub interpreter, so not strictly necessary to define
WSGIApplicationGroup.
The big caveat on this is that some third party C extension modules
for Python will only work if code run in the Python main interpreter.
That is, the first or primary sub interpreter created within the
process when Python is first initialised.
The usual reason such modules only work in this first interpreter is
that they use the simplified C API for thread state management, an API
that will not work win secondary sub interpreters. The Python bindings
for subversion fall into this category.
Thus, if using Python bindings for subversion in conjunction with
Trac, you must tell mod_wsgi that the application must be run in that
first interpreter. This is done using:
# mod_wsgi
WSGIApplicationGroup %{GLOBAL}
where %{GLOBAL} is special name meaning the primary or first
interpreter. If using mod_python the equivalent would have been:
# mod_python
PythonInterpreter main_interpreter
> I am running apache on windoze and had avoided daemon mode because of the
> warnings that apache on windoze does not support daemon processes (I am sure
> I read that somewhere but typically cannot find references now)?
As explained, on Windows you have no choice as that feature doesn't
exist and will never exist.
For Windows this is general is not an issue as Apache on that platform
is single process and multithread and don't run up against various of
the problems you do with embedded mode that you do on UNIX systems.
You still though have to use WSGIApplicationGroup to force Trac to run
in first interpreter if Python subversion bindings used.
That you are stuck with a single process, means you can't run multiple
distinct Trac installations on one server if they use distinct Trac
code, plugins, dependencies etc. This is because for a single
interpreter you can't have multiple versions of same code coexisting.
For further information about process/threading models of mod_wsgi
read:
http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading
For potential issues with using embedded mode, read:
http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html
Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Users" 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/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---