查看节点中cpu占用的指令是什么

  1. 进入当前节点的shell
./bin/emqx remote_console
  1. 查看当前节点的collector有哪一些

执行:

Prev = prometheus_registry:collectors(default).

结果会返回一个这样的列表:
[emqx_prometheus,emqx_prometheus_mria,prometheus_boolean,
prometheus_counter,prometheus_gauge,prometheus_histogram,
prometheus_mnesia_collector,prometheus_quantile_summary,
prometheus_summary,prometheus_vm_dist_collector,
prometheus_vm_memory_collector,
prometheus_vm_msacc_collector,
prometheus_vm_statistics_collector,
prometheus_vm_system_info_collector]

  1. 清空collector
 prometheus_registry:clear(default).
  1. 再次用命令查看collectors,应该是空的
prometheus_registry:collectors(default).
  1. 注册新的collector(主要是删除那些影响CPU的collector
Now = Prev -- [prometheus_mnesia_collector, prometheus_vm_dist_collector,prometheus_vm_memory_collector,prometheus_vm_msacc_collector,prometheus_vm_statistics_collector,prometheus_vm_system_info_collector],
prometheus_registry:register_collectors(default, Now).
  1. 再次用命令查看collector,确认是不是没有那些vm相关的了。没有就是成功了。
  2. 按ctrl + C 后出再提示,再按小a 字母即 abort ,退出erlang shell

但是下次重启,或新的节点启动,还得按上面的步骤来一次。