Tornado receive amounts of requests which handle in a thread pool, when tasks done it will add callbacks on IOLoop to response to the clients, so my question is how to resolve too many callbacks in tornado ioloop that slow down the response?
Asked
Active
Viewed 269 times
0
-
give us some code to complete.... – Kartoch Apr 11 '17 at 07:15
-
Tornado does not typically use a thread pool, it schedules all work on the main thread using an event loop. Can we see a complete, compilable, working example of the code that demonstrates the problem please? – A. Jesse Jiryu Davis Apr 11 '17 at 11:17
-
Here is the code 【https://github.com/duduool/iceworld/blob/master/multithreadtornado/lib/route.py】,We use IOLoop to receive requests and then submit the task to a thread pool mean while add a callback to the Main IOLoop when task done ioloop will run the callback and return the real reaults to clients,I just read the tornado source code,I found tornado use a `for` loop to run the callbacks,what if there has thounds of callbacks which will cost hundreds milliseconds to finish them, it will BLOCK the ioloop, am i right? – oo Qiao Apr 12 '17 at 03:54