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

Evgeny Khramtsov xramtsov at gmail.com
Fri May 18 18:46:54 MSK 2018


Fri, 18 May 2018 18:35:35 +0300
Sergej Pupykin <ml at sergej.pp.ru> wrote:

> On 15.05.2018 15:22, Evgeny Khramtsov wrote:
> > computing some regular expression. I need to see detailed traceback
> > of one of those processes to say what regexp is calculated exactly
> > and from what piece of code. However, this requires more
> > debugging.  
> 
> It looks like I catch it again. Could please tell me how to get
> backtrace from erlang?

Strictly speaking getting backtrace of the running process is not that
easy. What you can do is to look at current function:

$ 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).


More information about the ejabberd mailing list