On Nov 2, 8:31 pm, Bartosz Broda <bartosz.br...@gmail.com> wrote:
> On Sat, Oct 31, 2009 at 10:17 AM, Graham Dumpleton
>
>
>
>
>
> <graham.dumple...@gmail.com> wrote:
>
> > On Oct 30, 6:33 pm, Bartosz Broda <bartosz.br...@gmail.com> wrote:
> >> Hello Graham,
>
> >> I was reporting the problem with "instance.__dict__ not accessible in
> >> restricted mode" inhttp://trac.edgewall.org/ticket/3371#comment:73. I
> >> cannot investigate the issue in more details at the moment, as I have
> >> a few deadlines approaching.  I will try to mirror the configuration
> >> in VM environment in next week. If the errors will still occur, then I
> >> will be able to provide the vm image for further inspection. Perhaps I
> >> did something wrong during the configuration ofmod_wsgifor use with
> >> Trac (I followed this guide:http://trac.edgewall.org/wiki/TracModWSGI,
> >> but I might have miss some details).
>
> > 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.

It is certainly a bad idea to to run multiple Trac instances in same
interpreter where not the same code base, different versions of
plugins, or dependent modules or where need distinct Python egg cache
directories for projects. Also should be avoided if relying on
os.environ for setting Trac location.

The Python egg cache is a particular problem in your code as you
change it on every request and that could screw up badly on a
multithreaded configuration.

So, that particular auto generated trac.wsgi from trac-admin is
actually a bit dangerous. Normally one should not be setting Python
egg cache directory like that. It should be set once only.

Graham


> >> PS. In the meantime I can provide some details concerning my
> >> configuration - what further info do you need?
>
> > The Apache configuration related to mod_wsgi would be best starting
> > point.
>
> For every project I have this configuration:
>
> WSGIScriptAlias /trac/PROJECT /var/trac/PROJECT/eggs/cgi-bin/trac.wsgi
>
> <Directory /var/trac/PROJECT/htdocs>
>     WSGIApplicationGroup %{GLOBAL}
>     Order deny,allow
>     Allow from all
> </Directory>
>
> The trac.wsgi files are created by trac-admin <env> deploy <dir>, so
> it looks like that:
>
> import os
>
> def application(environ, start_request):
>     if not 'trac.env_path_parent_dir' in environ:
>         environ.setdefault('trac.env_path', '/var/trac/PROJECT')
>     if 'PYTHON_EGG_CACHE' in environ:
>         os.environ['PYTHON_EGG_CACHE'] = environ['PYTHON_EGG_CACHE']
>     elif 'trac.env_path' in environ:
>         os.environ['PYTHON_EGG_CACHE'] = 
> os.path.join(environ['trac.env_path'],
>                                                       '.egg-cache')
>     elif 'trac.env_path_parent_dir' in environ:
>         os.environ['PYTHON_EGG_CACHE'] =
> os.path.join(environ['trac.env_path_parent_dir'],
>                                                       '.egg-cache')
>     from trac.web.main import dispatch_request
>     return dispatch_request(environ, start_request)
>
> This configuration worked rather well in case of one and two projects.
> After that I added another 6 projects it started to throw
> RuntimeError. It works with similar configuration using mod_python
> (and it is faster then configuration based on modwsgi!).
> Another thing to notice is that on the same instance of apache there
> is one Django application, tomcat5.5 and a few php sites (including
> some soap based web services). Half of the trac instances use mysql
> and another half use sqlite.
>
> Best regards,
>   Bartosz
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to