Sorry for delayed reply. Moderation messages haven't been getting through and also traveling away from home.
Doing what you want in that specific way is quite hard. Before I try and explain what options do exist and why it is all quite complex, can you explain what is the underlying problem you are trying to solve? At the moment you are asking about your desired solution but it doesn't really explain why it is specifically needed. Note that my replies over the next few days will be intermittent. Graham On Monday, 30 January 2012, pgpython <[email protected]> wrote: > I am creating a website using django and want to restrict how long a > request takes and how much cpu usage and time it takes to execute the > code to 10% and 1 second. In the event it exceeds this i would > prefably like to raise an exception. At the moment my code does > something like this: > > resource.setrlimit(resource.RLIMIT_CPU, (10, -1)) > signal.signal(signal.SIGXCPU, cpu_signal) > signal.signal(signal.SIGALRM, timeout_signal) > signal.alarm(1) > #Do some stuff > signal.alarm(0) > > in my apache config i have > > WSGIRestrictSignal off > > and in my vhost I have > WSGIDaemonProcess django user=pg group=pg processes=10 threads=1 > display-name=django-web > WSGIProcessGroup django > > > However when i execute the request i get the exception signal only > works in main thread so i printed out the thread name and thread count > using threading and found the thread count is and the thread name is > MainThread. Can someone explain to me where I have gone wrong please? > > -- > 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. > > -- 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.
