On May 5, 3:36 am, Shadow <shadow.fusion.m...@gmail.com> wrote:
> Hi,
>
> I'm developing my site at the moment (locally) and it has an infinite
> loop somewhere. But my requests aren't timing out. The apache
> processes just get larger and larger, till I have to kill apache.
>
> I'm guessing I need to set a timeout setting, but I don't know where.
>
> Apache?mod_python? Python? Django?

This isn't really easily done. There are a couple of choices.

The first is to use fastcgi, although implementation needs to support
feature, and configure a request timeout in fastcgi setup. What will
happen is that a specific request takes longer than a certain amount
of time, fastcgi will kill off the whole process. If there are
concurrent requests, they will also be killed.

The second option is to use mod_wsgi in daemon mode. In this case you
need to set inactivity-timeout option. This doesn't work quite the
same as fastcgi and is instead meant to shutdown process if there is
no activity at all, where activity is measured as no reads from input
and no output generated. Do be aware though that if multithreaded
process and there are concurrent requests, they are regarded as
activity. In other words, in mod_wsgi inactivity is measured across
the whole process and not an individual request. If condition is
satisfied then process will be shutdown and replaced with a new one.
While you sort this problem out, you may therefore want to run daemon
mode in single thread/multi process configuration.

In summary, the only option is to kill off whole process through one
means or another, there isn't any way of terminating a specific Python
thread within a process.

End result is that you are just better off fixing your
application. :-)

Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to