Analyzer page-fault-by-pid
Name
page-fault-by-pid - Page fault order by process ID
This analyzer monitors page fault events across all processes in the system by hooking into the kernel’s page fault handler. It captures C-land stack traces and distinguishes between minor faults (page in memory but not mapped) and major faults (page needs disk I/O). Results are aggregated by process ID and displayed as stacked bar charts, ranking processes by total fault count. This helps identify memory-intensive processes and diagnose performance issues related to memory access patterns.
Resource Category
CPU.
Application Type & Technical Stack
- All
Command Line Syntax
The analyzer can be invoked directly on the command-line via the orxray
utility from the openresty-xray-cli software package.
Alternatively, the analyzer can also be invoked manually or automatically on the web console UI of OpenResty XRay (like on the Advanced web page).
# PID is the target process PID.
orxray analyzer run page-fault-by-pid -p PID
# trace a shell command directly
orxray analyzer run page-fault-by-pid -c SHELL_CMD
# PGID is the process group ID or any process's PID within the target process
# group.
orxray analyzer run page-fault-by-pid -p -PGID
# trace any processes started from the specified executable path.
orxray analyzer run page-fault-by-pid --exe /path/to/exe/file
Tracing Multiple Processes
Supported.
Output Formats
- Bar Charts
- Plain Texts
Output Example
[{
"title": "Page flts",
"subtitle": "Order by min-flt,maj-flt",
"type": "stacked-bar",
"categories": [
"nginx(375608)", "systemd(1)", "systemd-journal(483)",
"nginx(2141144)", "nginx(2721910)", "bash(2141146)",
"nginx(2721913)", "systemd(2141074)", "aliyun-service(3875331)",
"rsyslogd(675)", "script(2141145)"
],
"series": [
{"name": "min fault", "data": [6691, 412, 294, 145, 122, 70, 22, 12, 4, 1, 1]},
{"name": "major fault", "data": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}
]
}]
Author
The OpenResty Inc. Team.
Copyright
Copyright (C) by OpenResty Inc. All rights reserved.