FIND Command
Remove Certain Files in a Search/Find
find . -name '*.log' -exec rm -fr {} \;
Search for a class file inside a jar file
find . -name '*.jar' -exec bash -c "echo {} && jar tvf {} | grep Name_Searching_For " \;
See if a certain process is listening on a port
netstat -an | grep LISTEN
Checking open files
Shows Files Open Related to Java or ACES
echo /proc/`ps -ef | grep java | grep -v grep | awk '{ print $2 }'`/fd | xargs ls -1 | wc -l
Shows Files Open Related to Java or ACES
ls /proc//fd | wc -l
Shows All of the Processes and the Tree
pstree -A | more
Monitoring processes
top -u aces; // once it comes up….press "1" to see all the cores
top -H -u aces; // once it comes up….press "1" to see all the cores [will show you the thread usage as opposed to the CPU usage]
mpstat -P ALL; // shows overall CPU usage
Monitoring Performance
/usr/bin/sar 1 20; // Run sar command 20 times…with 1 second between it
Monitoring Disk I/O
Monitor Input/Output Devices
iostat -d -x -N
: name of device more /etc/fstab show you the mount point to ACES directory
: number of seconds between each capture of IO
: number of times to run default forever
more /etc/fstab (file that tells you the names of
mount points)
df -k (will also tell you the mount points)
iostat output
await: avg. time servicing request (svctm) + avg. time waiting in request queue.
svctm: avg. time servicing request
await should be close to svctm, means all time spent processing io. If wait greater svctm means io requests are waiting in queue a long time and there is a PROBLEM!
Monitor IO for Each CPU
mpstat -P all
Java Garbage Collector Monitoring
jstat -gc
Options
* -gc
* -gcutil
* -gcnew
* -gccapacity
If want to monitor GC stats on actual server put following in JBoss
startup
-verbose:gc (print the GC logs)
-Xloggc: (for more comprehensive GC logging)
-XX:+PrintGCDetails (for more detailed output)
-XX:+PrintTenuringDistribution (displays the tenuring thresholds assumed by the JVM)
Java Stack Dump of Running Process
jstack >
No comments:
Post a Comment