Not sure I understand the issue but you should not have time.sleep in code. It causes the threads to live longer then necessary and make you vulnerable to DoS attacks.
If you need to do something computationally expensive you need to use the scheduler and perform the tack using a background process. Anyway, one slow request should not slow down other requests unless: 1) the other request are performed by the same user (in this case the session is locked unless you session._unlock(response)) 2) the slow process keeps the database locked (you can unlock it by adding db.commit() after each db insert/delete/update) On Friday, 2 March 2012 23:34:27 UTC-6, Chris wrote: > > Thanks for the suggestions, as well as helping with my somewhat > ambiguous question :). I'll try time.sleep, and moving to tornado, as > a belt-and-suspenders kind of approach. I am using rocket and didn't > realize the GIL was an issue. > > Chris > > On Mar 2, 7:37 pm, Ricardo Pedroso <[email protected]> wrote: > > On Fri, Mar 2, 2012 at 4:33 AM, Chris <[email protected]> wrote: > > > I've got a web2py app that processes an uploaded file. When I upload a > big > > > file, it pushes the CPU to 100% and blocks out all other processes. > > > > > How do I limit this thread so that other things can go through? Any > ideas > > > would be great. > > > > The info that you gave is not sufficient to give an accurate answer. > > > > What are the webserver? > > If it's the rocket webserver bundled with web2py than if you have a > > thread with CPU intensive task > > it will block the others threads. This is due to the python GIL. > > > > Probably you have some loops to process the file, > > so just use time.sleep inside those loops. > > Using time.sleep will release the GIL giving other threads a chance to > run. > > > > time.sleep(.1) should do it. > > > > Ricardo

