概述

LSF mbatchd 性能指标帮助管理员识别 mbatchd 性能问题的根本原因,以便采取适当的纠正措施。这些指标在问题与集群环境相关时特别有用,例如共享存储或网络连接的性能问题。

启用方式

方法 说明
lsf.conf 配置 设置参数后重启 mbatchd
badmin perflog 动态启用,无需重启

在 lsf.conf 中配置

lsf.conf 文件中设置以下参数,然后运行 badmin mbdrestart 使配置生效:

1
2
3
4
5
6
7
8
# 启用性能日志
LSB_ENABLE_PERF_METRICS_LOG=Y

# 设置性能日志目录
LSB_PERF_METRICS_LOGDIR=<directory>

# 采样周期(秒)
SCHED_METRIC_SAMPLE_PERIOD=300

使用 badmin perflog 启用

1
badmin perflog [-t sample_period] [-d duration] [-f log_file_name] [-o]

启用后,mbatchd 将定期将性能数据写入性能日志文件。

性能日志格式

日志示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Oct  7 08:57:11 2022 8036 6 8.0.1 sample period: 300 307
Oct  7 08:57:11 2022 8036 6 8.0.1 job_submission_log_jobfile logJobInfo: 2741 0 104 0 632 0 10 0 10 0 10 0 80
Oct  7 08:57:11 2022 8036 6 8.0.1 job_submission do_submitReq: 3023 0 166 0 2753 0 10 0 480 0 10 0 230
Oct  7 08:57:11 2022 8036 6 8.0.1 job_status_update statusJob: 0 0 0 0 0 0 0 0 0 0 0 0 0
Oct  7 08:57:11 2022 8036 6 8.0.1 job_rusage_update rusageJob: 0 0 0 0 0 0 0 0 0 0 0 0 0
Oct  7 08:57:11 2022 8036 6 8.0.1 sched_get_new_job doSchedGetJobReq:  59 45 143 93 5 0 0 0 0 0 0 0 0
Oct  7 08:57:11 2022 8036 6 8.0.1 sched_get_resource doSchedGetRsrcReq: 59 129 3483 382 22 0 10000 169 10 0 0 0  0
Oct  7 08:57:11 2022 8036 6 8.0.1 job_dispatch_read_jobfile readLogJobInfo: 0 0 0 0 0 0 0 0 0 0 0 0 0
Oct  7 08:57:11 2022 8036 6 8.0.1 job_dispatch EM_executeJobCtrlDecsn: 0 0 0 0 0 0 0 0 0 0 0 0 0
Oct  7 08:57:11 2022 8036 6 8.0.1 sched_publish_decision doSchedPublishDecision: 0 0 0 0 0 0 0 0 0 0 0 0 0
Oct  7 08:57:11 2022 8036 6 8.0.1 sched_publish_pending_reason doSchedPublishReason: 0 0 0 0 0 0 0 0 0 0 0 0 0
Oct  7 08:57:11 2022 8036 6 8.0.1 mbd_call_sbd call_server: 0 0 0 0 0 0 0 0 0 0 0 0 0
Oct  7 08:57:11 2022 8036 6 8.0.1 mbd_update_load RB_updateLoad: 18 1880 3836 2613 47 0 0 0 0 0 0 0 0
Oct  7 08:57:11 2022 8036 6 8.0.1 mbd_query_job fork: 263 353 2596 1206 317 0 0 0 0 0 10000 228 60
Oct  7 08:57:11 2022 8036 6 8.0.1 mbd_clean_job clean: 14 1 3 2 0 0 0 0 0 0 0 0 0
Oct  7 08:57:11 2022 8036 6 8.0.1 mbd_event_switch switchEvent: 0 0 0 0 0 0 0 0 0 0 0 0 0
Oct  7 08:57:11 2022 8036 6 8.0.1 job_dependency_eval checkJgrpDep: 59 12 2313 0 0 0 0 0 0 0 0 0
Oct  7 08:57:11 2022 8036 6 8.0.1 mbd_channel chanSelect/chanPoll: 2375 3 2012 299484 0  10000 4 10 0 10000 4 10

日志字段说明

每行日志包含以下字段:

字段 说明
Metric category name 指标类别名称
Function name 函数名称

运行时间指标 (rt_*)

字段 说明
Count 采样周期内函数调用总次数
rt_min 单次函数调用的最小运行时间
rt_max 单次函数调用的最大运行时间
rt_avg 函数调用的平均运行时间
rt_total 所有函数调用的总运行时间

用户态 CPU 时间指标 (ut_*)

字段 说明
ut_min 单次调用的最小用户态 CPU 时间
ut_max 单次调用的最大用户态 CPU 时间
ut_avg 调用的平均用户态 CPU 时间
ut_total 所有调用的总用户态 CPU 时间

系统态 CPU 时间指标 (st_*)

字段 说明
st_min 单次调用的最小系统态 CPU 时间
st_max 单次调用的最大系统态 CPU 时间
st_avg 调用的平均系统态 CPU 时间
st_total 所有调用的总系统态 CPU 时间

主要指标类别

类别 函数 说明
job_submission_log_jobfile logJobInfo 作业提交日志写入
job_submission do_submitReq 作业提交请求处理
job_status_update statusJob 作业状态更新
job_rusage_update rusageJob 作业资源使用更新
sched_get_new_job doSchedGetJobReq 调度器获取新作业
sched_get_resource doSchedGetRsrcReq 调度器获取资源
job_dispatch_read_jobfile readLogJobInfo 读取作业文件
job_dispatch EM_executeJobCtrlDecsn 作业调度执行
sched_publish_decision doSchedPublishDecision 发布调度决策
sched_publish_pending_reason doSchedPublishReason 发布等待原因
mbd_call_sbd call_server mbatchd 调用 sbatchd
mbd_update_load RB_updateLoad 更新负载信息
mbd_query_job fork 作业查询
mbd_clean_job clean 作业清理
mbd_event_switch switchEvent 事件切换
job_dependency_eval checkJgrpDep 作业依赖评估
mbd_channel chanSelect/chanPoll 通道轮询

性能分析技巧

识别慢操作

检查 rt_max 值较高的记录,可能指示:

  • 共享存储 I/O 瓶颈
  • 网络延迟问题
  • 资源竞争

识别高负载操作

检查 Countrt_total 值:

  • Count:操作频繁调用
  • rt_total:累计消耗时间多

关注关键操作

  • job_submission:作业提交性能
  • mbd_update_load:负载更新效率
  • mbd_query_job:查询处理性能
  • mbd_channel:通信性能

参考资料

  1. IBM Documentation - Performance metrics for mbatchd
  2. IBM Documentation - Best practices and tips for LSF