[mod_python] execution time limit

Gustavo Henrique Cervi gustavo-listas at overstep.com.br
Wed Jan 10 13:20:22 EST 2007


Python handler running under mod_python.
Im using the "mod_python.publisher" handler.

-Gustavo


Graham Dumpleton wrote:
> Gustavo Henrique Cervi wrote ..
>   
>> Hi.
>>
>> How can I to limit the execution time for an python script?
>> Something like max_execution_time on PHP..
>>     
>
> Are you talking a CGI script written in Python or a Python handler running
> under mod_python?
>
> Either way you would have to program such ability within the script. Ie., if
> the script is performing some sort of calculation, it would need to
> occasionally check itself how long it has been going and abort if need be. If
> you are communicating with other processes, rather than block you are going to
> have to use some sort of mechanism which will allow you to timeout an
> operation. Database systems don't usually allow this though. Depending on the
> circumstances, you may be able to farm the operation off to a distinct thread
> with the parent waiting for the thread to complete, but if it doesn't complete
> in time for it to send back failure. The separate thread will still continue
> until it completes though as not easy to kill threads.
>
> You might explain more about what you are actually trying to do.
>
> Graham
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20070110/c2915da7/attachment.html


More information about the Mod_python mailing list