NUMA精细化分析
命令功能
基于ARM SPE的能力分析得到系统精细化的DDR访问、
命令格式
1 | devkit tuner numafast [-d <DURATION> | --duration=DURATION] [-i <INTERVAL> | --interval=INTERVAL] |
参数说明
参数 |
参数选项 |
说明 |
---|---|---|
-h/--help |
- |
获取帮助信息。 |
-o/--outpath |
- |
设置报告数据压缩包名称和输出路径,默认生成在当前所在目录;需和--package配合使用。 |
-l/--log-level |
0/1/2/3 |
设置日志级别,默认为1。
|
-d/--duration |
- |
设置采集时长,单位为秒,取值范围2至172,800秒,默认为一直采集,可使用Ctrl+\取消任务或Ctrl+C停止采集并进入分析。 |
-i/--interval |
- |
设置采集间隔,默认为5秒,取值范围2至30秒。 |
-c/--count |
- |
设置SPE采集指令间隔,取值范围1至4,294,967,295个,默认为2048。 |
-n/--num |
- |
设置需要展示的topN的进程数,默认为10个,取值范围1至30个;报告结果的以进程访问流量降序展示,若SPE实际采集进程数小于设置的N则以实际采集为准。 |
-t/--threads |
- |
设置需要展示的topN的线程数,默认为5个,取值范围1至10个;报告结果的以线程访问流量降序展示,具体展示个数与进程相同规则。 |
--package |
- |
设置是否生成报告数据压缩包,名称默认为numafast-时间戳.tar。 |
-f/ --file |
- |
设置仅生成报告数据而不将其生成可使用的报告数据压缩包。该参数需和--package配合使用。 |
使用示例
命令:
1 | devkit tuner numafast -d 10 -i 2 -c 2048 -n 3 -t 3 --package |

- 该命令采集参数为采样间隔2秒,SPE采集指令间隔为2048个,展示Top3的进程数,并生成报告数据压缩包到默认路径。
- 不设置-d参数时可使用Ctrl+\取消任务或Ctrl+C停止采集;若使用-d参数,输出报告数受-i参数影响,例:-d 10 -i 2(采样时长10秒,采样间隔2秒,则生成报告数为5份)。
- 报告回显仅为举例,只显示一份报告,具体报告结果请以实际使用为准。
返回信息如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | Enter analyze mode, please wait 5 seconds... NUMAFAST ANALYSIS(Press Ctrl+C to exit) ========================================================================================== 1. System's numa score : 0.88 Note: score = (max cost - real cost) / (max cost - min cost) real cost = SUM(0<=i,j<node number) numa distance(i, j) * access percentage(i, j) max cost = MAX(numa distance) , min cost = MIN(numa distance). This score is best at 1 and worst at 0. Format: traffic | numa distance | access percentage. DST_0 DST_1 DST_2 DST_3 SRC_0 0.63GB|10|38.24% 1.03GB|12|23.53% 0.10GB|20|8.82% 0.12GB|22|2.94% SRC_1 0.00GB|12|0.00% 1.16GB|10|26.47% 0.00GB|22|0.00% 0.00GB|24|0.00% SRC_2 0.00GB|20|0.00% 0.00GB|22|0.00% 0.00GB|10|0.00% 0.00GB|12|0.00% SRC_3 0.00GB|22|0.00% 0.00GB|24|0.00% 0.00GB|12|0.00% 0.00GB|10|0.00% ========================================================================================== 2. Node detail information of memory access traffic: Note:RMA(Die): Access traffic across NUMA dies. RMA(Socket): Access traffic across NUMA sockets. LMA: Local access traffic on the NUMA node. %CPU: Number of occupied CPU cores. For example, 600% indicates that 6 CPU cores are occupied. NID RMA(Die) RMA(Skt) LMA %RMA MEM(all) MEM(free) %MEM %CPU 0 1.03GB 0.22GB 0.63GB 66.5 63.21GB 0.27GB 99.6 137.1 1 0.00GB 0.00GB 1.16GB 0.0 63.93GB 0.77GB 98.8 93.2 2 0.00GB 0.00GB 0.00GB 0.0 63.93GB 10.69GB 83.3 96.4 3 0.00GB 0.00GB 0.00GB 0.0 62.93GB 48.75GB 22.5 109.6 ========================================================================================== 3. Show top 3 processes and top 3 threads which sorted by memory access: Note: If the collected processes less than the number specified by -n (--num), only the actual processes are displayed. ACCESS: Percentage of the process access traffic to the total traffic. Top N sorting is based on this. Threads are the same. MIGRATED X|Y: X indicates how many times threads of the process are migrated between NUMA nodes, and Y indicates the number of threads in the process. %CPU: The meaning is the same as that of the node data, but the data of the first report is not included. PID(TID) SCORE ACCESS RMA_Die RMA_Skt LMA %RMA MIGRATED %CPU COMMAND 159706 0.98 86.19% 0.00GB 0.02GB 0.69GB 2.30 0|1 5.00 gunicorn └─201754 0.98 86.19% 0.00GB 0.02GB 0.69GB 2.30 -|- 1.00 gunicorn 200956 0.76 11.05% 0.04GB 0.02GB 0.03GB 68.12 0|2 0.50 gunicorn ├─254073 0.73 8.14% 0.02GB 0.02GB 0.03GB 56.71 -|- 0.00 gunicorn └─254062 0.86 2.91% 0.02GB 0.00GB 0.00GB 100.00 -|- 0.00 gunicorn 159681 0.86 1.98% 0.02GB 0.00GB 0.00GB 100.00 0|1 0.00 gunicorn └─159681 0.86 1.98% 0.02GB 0.00GB 0.00GB 100.00 -|- 0.00 gunicorn ========================================================================================== The report /root/numafast-20241121-191339.tar is generated successfully To view the summary report, you can run: devkit report -i /root/numafast-20241121-191339.tar To view the detail report, you can import the report to WebUI or IDE |
- 输出报告说明报告由三部分组成,分别为访存矩阵信息,内存访问流量的节点详细信息和按内存访问排序的进程信息。
- 访存矩阵
每个数据有三个组成,分别为SRC到DST的带宽流量,SRC到DST的NUMA切换次数,该SRC到DST的流量在总流量的占比。
- 内存访问流量的节点详细信息
表2 节点详细信息表头说明 参数
说明
NID
NUMA的ID。
RMA(Die)
跨NUMA的访问流量。
RMA(Skt)
跨片访问流量。
LMA
NUMA节点上的本地访问流量。
%RMA
远端访问流量占比。
MEM(all)
总内存大小。
MEM(free)
可使用内存的大小。
%MEM
内存使用率。
%CPU
占用CPU核数,如600%表示占用6个CPU核。
- 显示按内存访问排序的前N个进程信息
表3 进程信息表头说明 参数
说明
PID(TID)
进程号/线程号。
SCORE
NUMA情况评分。
ACCESS
进程/线程访问流量占总流量的百分比,Top N的排序就是以此为基础的。
RMA(Die)
跨NUMA的访问流量。
RMA(Skt)
跨片访问流量。
LMA
NUMA节点上的本地访问流量。
%RMA
远端访问流量占比。
MIGRATED
线程在不同NUMA节点的迁移次数和进程的线程数。
%CPU
CPU使用率。
COMMAND
进程/线程的命令行。
- 访存矩阵