The error message:
"premature end of script: wsgi.py"
in the version of mod_wsgi you are using would generally indicate that the
daemon process had crashed in some way.
This is why I asked for the surrounding messages from the Apache error log as
there would be other messages in there confirming whether the daemon process
had in fact crashed. Using LogLevel of info would also results in extra
messages which would confirm what was happening.
One cause for a crashing process is that you are using a Python module with a C
extension which is not written so as to be safe to use in Python sub
interpreters.
http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Python_Simplified_GIL_State_API
When only running the one Python web application, you should really be forcing
it to run in the main interpreter context and that will avoid the problem.
Thus add to your configuration:
WSGIApplicationGroup %{GLOBAL}
Graham
On 04/02/2015, at 9:28 PM, Paul Royik <[email protected]> wrote:
> OK. In reality I have webapp django_math and inside it there is django site
> mathsite:
> ServerRoot "/home/simamura/webapps/django_math/apache2"
>
> LoadModule dir_module modules/mod_dir.so
> LoadModule env_module modules/mod_env.so
> LoadModule log_config_module modules/mod_log_config.so
> LoadModule mime_module modules/mod_mime.so
> LoadModule rewrite_module modules/mod_rewrite.so
> LoadModule setenvif_module modules/mod_setenvif.so
> LoadModule wsgi_module modules/mod_wsgi.so
> LoadModule alias_module modules/mod_alias.so
>
> LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\"
> \"%{User-Agent}i\"" combined
> CustomLog /home/simamura/logs/user/access_django_math.log combined
> ErrorLog /home/simamura/logs/user/error_django_math.log
> KeepAlive Off
> Listen 20241
> MaxSpareThreads 3
> MinSpareThreads 1
> ServerLimit 1
> SetEnvIf X-Forwarded-SSL on HTTPS=1
> ThreadsPerChild 5
> WSGIDaemonProcess django_math processes=2 threads=5
> python-path=/home/simamura/webapps/django_math:/home/simamura/webapps/django_math/mathsite:/home/simamura/webapps/django_math/lib/python2.7
> WSGIProcessGroup django_math
> WSGIRestrictEmbedded On
> WSGILazyInitialization On
> WSGIScriptAlias / /home/simamura/webapps/django_math/mathsite/mathsite/wsgi.py
>
> The real change here compared to previous week (on previous week there were
> no errors) is that I set threads=5 (not 12) as you advised.
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" 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/modwsgi.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"modwsgi" 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/modwsgi.
For more options, visit https://groups.google.com/d/optout.