When a Erlang system hangs I want to know what the system is doing during that time. For a c/c++ program, I can easily run the pstack, but I didn't find out a handy tool for this purpose in Erlang.
What is the pstack equivalent in Erlang?
Actually I want to check the running stack trace of the following process.
"/opt/couchbase/lib/erlang/erts-5.10.4.0.0.1/bin/beam.smp -P 327680 -K true -- -root /opt/couchbase/lib/erlang -progname erl --... "and I started a new Erlang shell and start the webtool and check the appmon however I can't find the above application. What may cause this?
Thanks
Concerning
pstackequivalent, have you read Erlang Profiling from official guide? It gives you lot of example on how to profile your application and find where your code stuck.Another useful tools is
observerit will show all working process, CPU usage, process stack and lot of more information.If you don't see anything with these tools, you can try with Erlang debugger.
Now concerning couchbase, if your application is currently running, you can connect to it with Erlang shell and launch previous quoted commands and applications.
I don't know if you are using couchbase alone or with couchdb, but, if you want to use
observeror other tools from command line, you can startcouchdbwith-iflag:In case of your application run remotely without GUI, you can use
etop, its a CLI alternative toobserver. You can also dumpetopoutput to file if you don't want to run it directly from your Erlang shell. IHMO, if you want more information concerning I/O or debug, useeprof,fprofand other profiling tools with dump file (see alsoeepprofiling tool, easy to use).Another alternative, if you are using SSH and want to see
observerwindow, you can use X11Forwarding with ssh:ssh -X $yourserverorssh -Y $yourserverand simply runobserver:start().in your Erlang shell.