[Erlang] Using fprof() to profile ejabberd

Note! The following approach could be applied for any Erlang application.

1. Start ejabberd in 'live' mode:

ejabberdctl live



2. Activate profiler for all processes:


fprof:trace([start, verbose, {procs, all}]).

3. Do some operations with your ejabberd server (connections/messages/etc) for as long time as you want.

4. Stop profiler

fprof:trace([stop]).

5. Create profile in memory.

fprof:profile().

6. Analyze and write profile to the file:

fprof:analyze([{dest, "/tmp/ejabberd.trace"}]).

For more information/options see manual page for fprof:

No comments: