文章
· 一月 28, 2023 阅读大约需 3 分钟

第五十九章 使用 ^PERFSAMPLE 监控进程 - 收集样本

第五十九章 使用 ^PERFSAMPLE 监控进程 - 收集样本

本主题介绍 ^PERFSAMPLE 实用程序,这是一种用于分析 IRIS® 数据平台流程的工具。该实用程序处理实时系统上的活动,并呈现采样活动的易于导航的细分,这可以提供对系统的洞察力。例如,可以通过检查 ECP 请求来发现应用程序瓶颈,或者通过查看等待事件的类型来识别整个系统的瓶颈。

要开始,请从感兴趣的 IRIS 实例上的 %SYS 命名空间运行 ^PERFSAMPLE

USER>set $namespace = "%SYS"

%SYS>do ^PERFSAMPLE

Collecting Samples

运行^PERFSAMPLE后,立即显示以下消息:

This utility performs high frequency sampling of processes on the system,
analyzing and counting data points in different ways to understand where
processes are spending most of their time. On ECP Data Servers, this also
offers sampling of the current request being processed and the states of
the ECPSvrW daemons doing the processing.

1) Sample Local Process Activity
2) Sample ECP Server Requests

Option?

如果实例没有来自ECP客户端(应用程序服务器)的传入ECP连接,则会自动选择上面的选项1

然后系统会提示输入以下信息:

  1. 要采样的过程或ECP连接。
  2. 是否忽略进程处于以下任一状态的样本:READREADWEVTWHANGSLCTSLCTWRUNW。当对ECP连接进行采样时,仅记录ECPSvrW进程非空闲的事件。

选择YES(默认值)可减少^PERFSAMPLE记录的事件数。当监控许多进程时,这会加快分析速度,并使用更少的内存。

  1. 每秒收集的样本数。
  2. 收集样本的总秒数。

在终端中,提示如下所示:

Enter a list of PIDs, * for all, or ? for ^%SS display: *
Ignore samples where the process appears idle (READ, HANG, etc)?
  Yes =>
Sample rate per second: 1000 =>
Number of seconds to sample: 30 =>

检查和分析样品

收集样本后,可以查看分析。分析是对抽样过程的一个或多个维度或组件的总结。也就是说,分析根据选择的维度对采样信息进行排序。

本节包括以下内容:
- 使用预定义分析的示例。
- 有关创建自定义分析的信息。
- 可用分析维度的描述。

使用以下键在分析器中导航:

Key Input Navigation Action
Up arrow or U Move the selector up
Down arrow or D Move the selector down
Right arrow or Enter Select the current item
Left arrow or Backspace Go back to the previous level
C Cycles through the following count displays:
Percent of total
Raw count
Percent of the current subset
(If multiple jobs are sampled) Average number of jobs found concurrently in this state
N or CTRL-D Next page (if multiple pages)
P or CTRL-U Previous page (if multiple pages)
Q Quit ^PERFSAMPLE

主登陆页面如下所示:

— PERFSAMPLE for Local Process Activity. 1.710949s at 11/17/2020 15:58:31
28479 samples | CPULoad* 0.91
Multiple jobs included: 1290 samples per job
----------------------------'?' for help----------------------------
Select an analysis to view:
New Analysis (press '+' any time)
Using CPU? -> PID -> Process State
Using CPU? -> Routine -> Namespace -> Process State
Process State -> Routine -> PID
Kernel Wait State -> Routine -> PID
讨论 (0)1
登录或注册以继续