How can i find what slow in my app based on the torndo 6.x ???

115 views
Skip to first unread message

gzg

unread,
Feb 3, 2020, 2:58:00 AM2/3/20
to Tornado Web Server
Hi, my friends,


I'm a user of tornado since tornado 4.x, in the past, i used "IOLoop.set_blocking_log_threshold(0.050)" to find what slow in my app,


Now, i want to use the tornado 6, but i find "IOLoop.set_blocking_log_threshold, IOLoop.log_stack, and IOLoop.handle_callback_exception have been removed." in the Tornado 6.0 Release notes.


So, my question is: How can i find what slow in my app based on the torndo 6.x ???


Thanks in advance for any idea.

Regards,
gzg

Pierce Lopez

unread,
Feb 3, 2020, 8:19:58 AM2/3/20
to python-...@googlegroups.com
See https://docs.python.org/3.7/library/asyncio-dev.html - in particular, if you enable asyncio debug mode:

> Callbacks taking longer than 100ms are logged. The loop.slow_callback_duration attribute can be used to set the minimum execution duration in seconds that is considered “slow”.

gzg

unread,
Feb 4, 2020, 12:44:53 AM2/4/20
to Tornado Web Server
Hi Pierce Lopez, thanks for your reply,

follow your link, i can see some log message in the centos command-line console like this:
/web_app/my_test.py:12 RuntimeWarning: coroutine 'TestErr.test' was never awaited
    self.test()

But, when i add a TimedRotatingFileHandler to the asyncio log object, and set the log level to DEBUG, I can not see that log message in log file, instead, just some lines like this:
[2020-02-04 12:33:29,590] - [DEBUG]: Using selector: EpollSelector

i try a lot ,but still can't achieve it

can anyone give me some advice??? that will be appreciated !







-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

在 2020年2月3日星期一 UTC+8下午9:19:58,Pierce Lopez写道:
Reply all
Reply to author
Forward
0 new messages