self.render takes a lot of time

48 views
Skip to first unread message

gef...@gmail.com

unread,
Sep 20, 2021, 10:50:54 AM9/20/21
to Tornado Web Server
Hello,

I have a simple search form where a user enters an id, I issue a request to a backend service, I am getting back a json string and pass it to a template by using:

params = {"name": "Myname", "age": "my age"}
self.render("result.html", balance=balance, **params)

The problem is that sometimes render might take up to 20 seconds. 
I have benchmarked it by adding an info log right before I call render and also an info log in def on_finish(self): 

What makes it a nightmare is the fact that timings are not always the same, even for the same input I get variables timings, between 2 and 30 seconds. Please note that params has more variables of several datatypes: lists, dicts etc and also "result.html" is somewhat complicated because it has 5-6 includes and some of those includes have other nested includes.
Any idea of what could cause this issue ? Any idea how to troubleshoot even further ?

Thanks,
George
Reply all
Reply to author
Forward
0 new messages