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.

Reply via email to