[ejabberd] Beam consumes > 400% CPU - why?

Sergej Pupykin ml at sergej.pp.ru
Mon May 21 12:40:42 MSK 2018


On Fri, 18 May 2018 18:46:54 +0300,
Evgeny Khramtsov wrote:
> 
> $ ejabberdctl debug
> ... you should be connected to the running ejabberd node ...
> ... now execute the following command inside this Erlang shell ...
> ... (don't forget trailing dot) ...
> > process_info(pid(X,Y,Z), current_function).
> 
> where X,Y,Z is the stuff you see as <X.Y.Z> in your etop output (this
> is a process id).
> Run the last command several times to see what functions are executed by
> the process.
> 
> If you want to see the message queue of the process, you should call:
> > process_info(pid(X,Y,Z), messages).

I replaced some strings to xxx/yyy:

(ejabberd at localhost)13> process_info(list_to_pid("<0.28046.0>"), messages).  
{messages,[{tcp,#Port<0.45881>,
                <<23,3,3,0,176,0,0,0,0,0,0,0,11,223,176,208,136,137,94,
                  229,3,32,254,...>>},
           {route,{iq,<<"rr-1526892638867-1429486524431307456-G5a/w2RBE/DxxMKdTzJWOGmuN8U=-55238004">>,
                      get,<<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>,
                           <<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>},
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,
                           <<"24086462178552933092180">>,<<"XXXX.YYYakov">>,
                           <<"XXXXcorporation.com">>,<<"24086462178552933092180">>},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526892698875-4373796492653212378-VrPiXqM7OX8rGiZ4XE+Besr4m+Y=-55238004">>,
                      get,<<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>,
                           <<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>},
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,
                           <<"24086462178552933092180">>,<<"XXXX.YYYakov">>,
                           <<"XXXXcorporation.com">>,<<"24086462178552933092180">>},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526892758898-17932437402618417500-bRbP2B1Ohl+H729ApQ/0NO9RHKw=-55238004">>,
                      get,<<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>,
                           <<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>},
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,
                           <<"24086462178552933092180">>,<<"XXXX.YYYakov">>,
                           <<"XXXXcorporation.com">>,<<"24086462178552933092180">>},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526892818956-13868124959974023673-tWnZmDMT1DYpE5c9f+Q1/amOcjg=-55238"...>>,
                      get,<<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>,
                           <<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>},
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,
                           <<"24086462178552933092180">>,<<"XXXX.YYYakov">>,
                           <<"XXXXcorporation.com">>,<<"24086462178552933092180">>},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526892878957-11287154166219262536-sgInp0lyHjeABr/GNBBFgJWeb7w=-5"...>>,
                      get,<<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>,
                           <<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>},
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,
                           <<"24086462178552933092180">>,<<"XXXX.YYYakov">>,
                           <<"XXXXcorporation.com">>,<<"24086462178552933092180">>},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526892938974-18289616894785588272-snS+dcu2au9mfEpSaSW2aOlASB"...>>,
                      get,<<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>,
                           <<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>},
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,
                           <<"24086462178552933092180">>,<<"XXXX.YYYakov">>,
                           <<"XXXXcorporation.com">>,<<"24086462178552933092"...>>},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526892999025-11489291385282604246-BIWuCiX7HTI/G7ngx7D1K8"...>>,
                      get,<<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>,
                           <<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>},
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,
                           <<"24086462178552933092180">>,<<"XXXX.YYYakov">>,
                           <<"XXXXcorporation.com">>,<<"2408646217855293"...>>},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526893059027-6039362544143012111-NCprcW/9PuaJkrgupdE"...>>,
                      get,<<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>,
                           <<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>},
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,
                           <<"24086462178552933092180">>,<<"XXXX.YYYakov">>,
                           <<"XXXXcorporation."...>>,<<"240864621785"...>>},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526893119032-2935021692534175520-us0pGk+AvTb6ksj"...>>,
                      get,<<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>,
                           <<"XXXX.YYYakov">>,<<"XXXXcorporation."...>>,<<>>},
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,
                           <<"24086462178552933092"...>>,<<"XXXX.YYYakov">>,
                           <<"XXXXcorporat"...>>,<<"24086462"...>>},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526893179064-6970207346738878470-NyZXHdZhJ9F"...>>,
                      get,<<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>,
                           <<"XXXX.YYYakov">>,<<"XXXXcorporat"...>>,<<>>},
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,
                           <<"2408646217855293"...>>,<<"XXXX.YYYakov">>,
                           <<"XXXXcorp"...>>,<<"2408"...>>},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526893239112-14695834876520393232-vPADK7"...>>,
                      get,<<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation.com">>,<<>>,
                           <<"XXXX.YYYakov">>,<<"XXXXcorp"...>>,<<>>},
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation."...>>,
                           <<"240864621785"...>>,<<"XXXX.YYY"...>>,<<"XXXX"...>>,
                           <<...>>},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526893299165-729332056250932160-S9Mu"...>>,
                      get,<<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporation."...>>,<<>>,
                           <<"XXXX.YYY"...>>,<<"XXXX"...>>,<<>>},
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporat"...>>,
                           <<"24086462"...>>,<<"XXXX"...>>,<<...>>,...},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526893359257-7085711996612544163"...>>,
                      get,<<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorporat"...>>,<<>>,
                           <<"XXXX"...>>,<<...>>,...},
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorp"...>>,<<"2408"...>>,
                           <<...>>,...},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526893419468-244978918378393"...>>,get,
                      <<>>,
                      {jid,<<"XXXX.YYYakov">>,<<"XXXXcorp"...>>,<<>>,<<...>>,...},
                      {jid,<<"XXXX.YYY"...>>,<<"XXXX"...>>,<<...>>,...},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526893479479-69654195686"...>>,get,<<>>,
                      {jid,<<"XXXX.YYY"...>>,<<"XXXX"...>>,<<>>,...},
                      {jid,<<"XXXX"...>>,<<...>>,...},
                      [{ping}],
                      #{}}},
           {route,{iq,<<"rr-1526893539507-1773447"...>>,get,<<>>,
                      {jid,<<"XXXX"...>>,<<...>>,...},
                      {jid,<<...>>,...},
                      [{...}],
                      #{}}},
           {route,{iq,<<"rr-1526893599570-125"...>>,get,<<>>,
                      {jid,<<...>>,...},
                      {jid,...},
                      [...],...}},
           {route,{iq,<<"rr-1526893659604"...>>,get,<<>>,
                      {jid,...},
                      {...},...}},
           {route,{iq,<<"rr-152689371"...>>,get,<<>>,{...},...}},
           {route,{iq,<<"rr-15268"...>>,get,<<>>,...}},
           {route,{iq,<<"rr-1"...>>,get,...}},
           {route,{iq,<<...>>,...}},
           {route,{iq,...}},
           {route,{...}},
           {route,...},
           {...}|...]}
(ejabberd at localhost)14> process_info(list_to_pid("<0.28046.0>"), current_function).
{current_function,{re,precomp_repl,1}}
(ejabberd at localhost)15> process_info(list_to_pid("<0.28046.0>"), current_function).
{current_function,{re,precomp_repl,1}}
(ejabberd at localhost)16> process_info(list_to_pid("<0.28046.0>"), current_function).
{current_function,{re,precomp_repl,1}}
(ejabberd at localhost)17> process_info(list_to_pid("<0.28046.0>"), current_function).
{current_function,{re,precomp_repl,1}}
(ejabberd at localhost)18> process_info(list_to_pid("<0.28046.0>"), current_function).
{current_function,{re,precomp_repl,1}}
(ejabberd at localhost)19> process_info(list_to_pid("<0.28046.0>"), current_function).
{current_function,{re,precomp_repl,1}}
(ejabberd at localhost)20> process_info(list_to_pid("<0.28046.0>"), current_function).
{current_function,{re,precomp_repl,1}}
(ejabberd at localhost)21> process_info(list_to_pid("<0.28046.0>"), current_function).
{current_function,{re,precomp_repl,1}}
(ejabberd at localhost)22> process_info(list_to_pid("<0.28046.0>"), current_function).
{current_function,{re,precomp_repl,1}}
(ejabberd at localhost)23> process_info(list_to_pid("<0.28046.0>"), current_function).
{current_function,{re,precomp_repl,1}}


More information about the ejabberd mailing list