I’m using a 3rd party API pretty heavily in my Tornado app, and it seems like after eliminating some other inefficiencies, I’m still experiencing 300-600ms response times per request. My best guess is that Tornado is re-negotiating the SSL connection every time, but I’m not sure how to get insight into where the request slowness is coming from.
I’m looking for something that will break down each phase of the connection by time, like “Certificate received: 100ms” and “Server response: 200ms”
I’m typically doing multiple asynchronous requests to the same server, like this:
liked_response, following_response, subscribed_response = \
yield [gen.Task(http_client.fetch, like_request),
gen.Task(http_client.fetch, following_request),
gen.Task(http_client.fetch, subscribed_request)]
How can I look deeper into Tornado’s networking stack, to identify which parts of my request are being slow?
Your best chances for debugging something like this would be
netcatandwiresharkor if you can find something that you can pipe your web process into to do some monitoring. Something similar todjango-debug-toolbar