2008/12/20 Frédéric Sidler <[email protected]>:
> I correct the apache configuration file accordingly to your comments (apache
> 2.2.8/mod_wsgi 2.3 on ubuntu 8.04) but nothing is loaded at apache restart.
> I want to preload a parser that takes time to use. It takes around 35
> seconds to load the first time. Why does it not load at apache startup with
> WSGIImportScript and WSGIProcessGroup directives.
>
> The second problem is that when I do some apache bench, it loads everything
> again and again. So I tried to play with WSGIDaemonProcess processes,
> threads and maximum-requests to avoid such reload of the parser.
>
> Below is the last apache.conf file I'm using. As you can see the
> WSGIImportScript is in this file outside the VirtualHost directive.
>
> WSGIImportScript /home/mixint/webapps/django/mixin/_lib/deploy/mixin.wsgi
> process-group=mixint application-group=mixint
>
> NameVirtualHost *
> <VirtualHost *>
>         ServerAdmin webmas...@localhost
>
>         DocumentRoot /home/mixint/webapps/django/mixin
>
>         ErrorLog /var/log/apache2/error.log
>
>         # Possible values include: debug, info, notice, warn, error, crit,
>         # alert, emerg.
>         LogLevel info
>
>         CustomLog /var/log/apache2/access.log combined
>         ServerSignature On
>
>         Alias /media/
> /usr/lib/python2.5/site-packages/django/contrib/admin/media/
>         <Directory
> /usr/lib/python2.5/site-packages/django/contrib/admin/media">
>                 Order allow,deny
>                 Options Indexes
>                 Allow from all
>                 IndexOptions FancyIndexing
>         </Directory>
>
>         SetEnv USER mixint
>         SetEnv DJANGO_SETTINGS_MODULE mixin.settings

How have you set up your WSGI script file? These settings would not
normally be of any use here for Django unless you are doing tricks
with delayed setting of os.environ in a WSGI application wrapper. If
you are doing that then a lot of Django wouldn't be getting imported
and configured until first request, irrespective of whether preloading
the WSGI script file. If you startup code is only triggered when
Django settings module is imported, then it will not be getting
triggered until that first request.

So, post your WSGI script file so can confirm what it is you are doing.

>         WSGIDaemonProcess mixint user=mixint group=mixin maximum-requests=0

A maximum-requests=0 option is redundant as that is the default,
meaning, unlimited.

>         WSGIProcessGroup mixint
>         WSGIApplicationGroup mixint
>         #WSGIReloadMechanism Process

WSGIReloadMechanism shouldn't be used. Default is 'Process' in
mod_wsgi 2.X. This directive will go away in mod_wsgi 3.0.

Graham

>         WSGIScriptAlias /
> /home/mixint/webapps/django/mixin/_lib/deploy/mixin.wsgi
>
>         <Directory /home/mixint/webapps/django/mixin/_lib/deploy>
>                 Order deny,allow
>                 Allow from all
>         </Directory>
>
> </VirtualHost>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"modwsgi" 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/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to