openresty/openresty-systemtap-toolkit

Example to use for ngx-lua-bt?

xeoncross opened this issue · 1 comments

This tool is very useful in locating the infinite Lua loop that keeps the Nginx worker spinning with 100% CPU usage. -ngx-lua-bt

That is exactly the problem I want to debug. Could you add more detail on what to look for when using this script? Is it just a backtrace?

@xeoncross Yes, it dumps a Lua-land backtrace.

You may also find the gdb command "lbt" more useful for this because it also dumps the local Lua variable values in each Lua function frame: https://github.com/openresty/nginx-gdb-utils#lbt

Also, the Lua-land flame graphs are also good for this: https://github.com/openresty/stapxx#lj-lua-stacks and can give you the big picture (like, you may be unlucky to run in a Lua backtrace that is actually not the dominating thing).