I guess wsgi uses these steps:

1. WSGI Process starts (Up to now no single request comes in)
2. HTTP Requests comes in. You can get this timestamp via X-Request-Start. 
See 
https://docs.newrelic.com/docs/apm/applications-menu/features/request-queue-server-configuration-examples
3. Django gets called. You can get this timestamp in a middleware
4. Django has created a response. You can get this timestamp in a middleware
5. Webserver starts to send the response to the client. I have no clue how 
to get this timestamp
6. Webserver has finished sending the response to the client. I have no 
clue how to get this timestamp
7. The WSGI Process waits until the next http response comes in. 
8. Jump to step2 if request_count < maximum_requests. Else jump to step1

Is this simplified sequence of steps correct?

We monitor the duration between step2 and step3 (queue-time) and log a 
warning if the duration is too long.

We use apache and wsgi. 

The configuration maximum-requests=N tells apache to terminate the wsgi 
worker process after N request.

If N gets reached the duration of queue-time (step2 to step3) is much 
longer. We guess that's because django.setup() takes some time

We could increase N (maximum_requests) to make this less likely, but is 
there no way to call django.setup() outside queue-time?

Regards,
  Thomas Güttler


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0c3d11a9-b72a-4322-a97a-da33d60cefdc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to