The Solaris operating system provides some additional tools for monitoring the performance of your processes. Each of the commands described in this section adds a small additional performance penalty to a process the first time that you use it, so they may not be appropriate to use on a live site (particularly on a continuing basis). See the UNIX man proc
page for more information on these and other commands. You can use the following commands to monitor performance and diagnose problems:
/usr/proc/bin/pstack
This command shows you the stack of thelwp
s in your Java process. Each Java thread is bound to anlwp
(light weight process) before it is run. You can use this command to determine which system calls your Java threads are waiting in (if any). You may see them all waiting in a read from a socket or in a native call to your JDBC driver. Sometimes this is not all that useful because you can’t tell which socket the threads are using.
/usr/proc/bin/pldd
This command helps you find out what native code is getting loaded into your JVM by showing you which.so
files are linked into each process.
/usr/proc/bin/pflags
This command shows the flags and the current wait state for eachlwp
in a process. You can use this command to determine the number of thread context switches and other information. The thread context switches are likely to be high if you have more than one CPU for each Dynamo process.
/usr/proc/bin/pfiles
This shows the open files for this process, which helps you diagnose whether you are having problems caused by files not getting closed.
lsof
This utility lists open files for running UNIX processes, likepfiles
. However,lsof
gives more useful information thanpfiles
.
truss -c -p
This command summarizes the count of system calls when you interrupttruss
. This can be useful to get an idea of how your JVM is interacting with the OS.