2009/11/25 GaryB <[email protected]>:
> We are running wsgi (version 2.6 on Red Hat Linux) in daemon mode.
>
> WSGI is configured as below:
>
> WSGIDaemonProcess services user=apache group=apache display-
> name=aviva_services processes=2 threads=5 maximum-requests=5000
> inactivity-timeout=300 deadlock-timeout=30 shutdown-timeout=30
>
> We continually monitor the web site using standard monitoring tools
> and during the re-start of the wsgi deamon process we are seeing our
> monitoring tools report error 404 when trying to access the website.
>
> Basically every time we receive an alert we also see this coincides
> with the re-start of the daemon.
>
> Would it be normal for these to be issue during this re-start process?
>
> Apologies if this question lacks information but mod_wsgi is new to
> me.
Set:
LogLevel info
in Apache configuration and capture all the error logs around the
event and send them to me, off list if you are concerned about
contents.
Also indicate whether the 404 comes from Apache or from your WSGI
application and indicate what the WSGI application is that you are
running.
Based on past cases I would suggest that your WSGI application has a
multithreading/ordering issue on startup. Need to confirm first that
the 404 is coming from your application and not Apache.
To work out if WSGI application, suggest wrapping your application
with the following. This will dump out details to error log when a 404
occurs. If you see this at time you get problem, then it is an issue
with your WSGI application.
# Original WSGI application.
def application(environ, start_response):
...
# Logging WSGI middleware.
import pprint
class LoggingMiddleware:
def __init__(self, application):
self.__application = application
def __call__(self, environ, start_response):
errors = environ['wsgi.errors']
def _start_response(status, headers):
if status.find('404') == 0:
pprint.pprint(('REQUEST', environ), stream=errors)
pprint.pprint(('RESPONSE', status, headers), stream=errors)
return start_response(status, headers)
return self.__application(environ, _start_response)
application = LoggingMiddleware(application)
Graham
--
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.