我们在 AWS EC2 实例中构建了 Ejabberd,并在东京、法兰克福和新加坡地区的 6 个 Ejabberd 服务器中启用了集群。每个 EC2 实例的操作系统、中间件、应用程序和设置完全相同。
但目前,法兰克福和新加坡地区的 Ejabberd CPU 已经超载。日本地区Ejabberd的CPU正常。
你能告诉我可疑的部分吗?
我们在 AWS EC2 实例中构建了 Ejabberd,并在东京、法兰克福和新加坡地区的 6 个 Ejabberd 服务器中启用了集群。每个 EC2 实例的操作系统、中间件、应用程序和设置完全相同。
但目前,法兰克福和新加坡地区的 Ejabberd CPU 已经超载。日本地区Ejabberd的CPU正常。
你能告诉我可疑的部分吗?
您可以查看有问题(和好的)节点的 ejabberd 日志文件,也许您会找到一些线索。
您可以在有问题的节点中使用未记录的“ejabberdctl etop”shell 命令。它类似于“top”,但运行在运行 ejabberd 的 erlang 虚拟机中
ejabberdctl etop
========================================================================================
ejabberd@localhost 16:00:12
Load: cpu 0 Memory: total 44174 binary 1320
procs 277 processes 5667 code 20489
runq 1 atom 984 ets 5467
Pid Name or Initial Func Time Reds Memory MsgQ Current Function
----------------------------------------------------------------------------------------
<9135.1252.0> caps_requests_cache 2393 1 2816 0 gen_server:loop/7
<9135.932.0> mnesia_recover 480 39 2816 0 gen_server:loop/7
<9135.1118.0> dets:init/2 71 2 5944 0 dets:open_file_loop2
<9135.6.0> prim_file:start/0 63 1 2608 0 prim_file:helper_loo
<9135.1164.0> dets:init/2 56 2 4072 0 dets:open_file_loop2
<9135.818.0> disk_log:init/2 49 2 5984 0 disk_log:loop/1
<9135.1038.0> ejabberd_listener:in 31 2 2840 0 prim_inet:accept0/3
<9135.1213.0> dets:init/2 31 2 5944 0 dets:open_file_loop2
<9135.1255.0> dets:init/2 30 2 5944 0 dets:open_file_loop2
<9135.0.0> init 28 1 3912 0 init:loop/1
========================================================================================
我做了“ejabberdctl etop”命令,但我得到了以下响应。
[root@trick01 ~]# ejabberdctl etop
Erlang/OTP 22 [erts-10.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]
Error Couldn't connect to node ejabberd
Usage of the Erlang top program
Options are set as command line parameters as in -node my@host
or as parameters to etop:start([{node, my@host}, {...}]).
Options are:
node atom Required The erlang node to measure
port integer The used port, NOTE: due to a bug this program
will hang if the port is not avaiable
accumulate boolean If true execution time is accumulated
lines integer Number of displayed processes
interval integer Display update interval in secs
sort runtime | reductions | memory | msg_q
What information to sort by
Default: runtime (reductions if tracing=off)
tracing on | off etop uses the erlang trace facility, and thus
no other tracing is possible on the node while
etop is running, unless this option is set to
'off'. Also helpful if the etop tracing causes
too high load on the measured node.
With tracing off, runtime is not measured!
setcookie string Only applicable on operating system command
line. Set cookie for the etop node, must be
same as the cookie for the measured node.
This is not an etop parameter
{"init terminating in do_boot","connection error"}
init terminating in do_boot (connection error)
Crash dump is being written to: //var/log/ejabberd/erl_crash_20220204-050847.dump...done
[root@trick01 ~]#