Locate the hottest Lua code paths in online OpenResty/Nginx servers (using OpenResty XRay)

Опубликовано: 03 Март 2026
на канале: OpenResty
482
9

Try out OpenResty XRay for free: https://openresty.com/en/xray/

In this tutorial, you will get a step-by-step tour of how to use OpenResty XRay to identify the most CPU-intensive Lua code paths in your OpenResty or Nginx applications.

These code paths are the ones that consume the most CPU time and may affect your application's performance.

Text version of this tutorial: https://blog.openresty.com/en/en/xray...

OpenResty XRay is a dynamic-tracing product that automatically analyzes your running applications to troubleshoot performance problems, behavioral issues, and security vulnerabilities with actionable suggestions.

Under the hood, OpenResty XRay is powered by our Y language targeting various runtimes like Stap+, eBPF+, GDB, and ODB, depending on the contexts.

OpenResty XRay is a truly non-intrusive dynamic analysis, which does not require installing any special modules or plugins in the target application, does not require recompiling the target application, and even does not require restarting the running process.

Music: https://www.bensound.com

0:13 Problem: high CPU usage
0:31 Open OpenResty XRay web console
1:01 Use the guidede analysis feature of OpenResty XRay to spot the hottest Lua code paths
2:03 Analysis report
2:54 Use vim editor
3:17 Automatic analysis and reports