Thursday, December 11, 2014

Stress Commands

MemoryUsage
du -hs /home/wcuser/* | grep [GM]


jstat -gcutil -t 10078 1000
jmap -heap <Proces ID of your JVM>
jmap -histo:live 18281 | head

jmap -dump:format=b,file=filename.hprof
jmap-dump:file=/mnt/heapdump_2017-01-25.data 29400


java -cp lib/WEB-INF/lib/*:/home/wcuser/stubs/lib/WEB-INF/classes:. wavecrest.stubs.BillDeskStubServer &

Stress Testing linux commands
sar  System activity reporter
sar -u 12 5
  -u 12 5: Comparison of CPU utilization; 12 seconds apart; 5 times.

mpstat -P ALL or mpstat -A

vmstat 5
Procs – r: Total number of processes waiting to run
Procs – b: Total number of busy processes
Memory – swpd: Used virtual memory
Memory – free: Free virtual memory
Memory – buff: Memory used as buffers
Memory – cache: Memory used as cache.
Swap – si: Memory swapped from disk (for every second)
Swap – so: Memory swapped to disk (for every second)
IO – bi: Blocks in. i.e blocks received from device (for every second)
IO – bo: Blocks out. i.e blocks sent to the device (for every second)
System – in: Interrupts per second
System – cs: Context switches
CPU – us, sy, id, wa, st: CPU user time, system time, idle time, wait time

vmstat -a
Iostat command reports CPU and I/O statistics. iostat command is used during performance analysis to narrow down the problematic areas in the system.

Sample output of iostat command and its explanation:

$ iostat
Linux 2.6.31-17-generic (sathiya-laptop) 05/25/10 _i686_ (1 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          25.99    0.78    7.43   12.77    0.00   53.03

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sda              27.40       797.19       201.27     800902     202208
sr0               0.03         1.24         0.00       1248          0


The first three columns of the CPU report show the percentage of CPU utilization that occurred while executing at the user level (applications), at the user level with a nice priority, and at the system level (kernel), respectively. The last two columns show the percentage of time the CPU was idle while it had an outstanding disk I/O request and while it did not have an outstanding disk I/O request.

The first line displays general information — Linux kernel version, hostname etc.,

Next two lines displays CPU statistics, in which the first 3 column displays average CPU usage. The 4th column displays the percentage of time the CPU were idle and waited for I/O response. 5th column displays percentage of waiting time of virtual CPU. 6th column displays the percentage of time the CPU is idle.


%util : Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100%.

Remaining line displays the device utilization report. First line in that is headers, such as number of Transfer per second, number of blocks read per second, blocks write per second, total block reads, total block writes.




"-Xms1536m -Xmx4096m -XX:MaxPermSize=256m -Xmn1024m -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -XX:+HeapDumpOnOutOfMemoryError -XX:+AggressiveOpts -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=10.10.18.200 -Dsun.rmi.dgc.server.gcInterval=120000 -Xloggc:./gclog -verbose:gc -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+UseParallelOldGC -XX:+UseAdaptiveSizePolicy -XX:MaxGCPauseMillis=100 -Dorg.apache.catalina.SESSION_COOKIE_NAME=OBELIX -Dorg.apache.catalina.SESSION_PARAMETER_NAME=obelix -javaagent:$BYTEMAN_HOME/lib/byteman.jar=listener:true,boot:$BYTEMAN_HOME/lib/byteman.jar -Dorg.jboss.byteman.transform.all"