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"

Friday, August 1, 2014

No SQL Systems

No SQL

Couch DB: Data Model is document. Where document is set of key value pairs. It uses optimistic lock mechanism for update of the records
memcached: key- value pair is the data model
Dyanmo: key- value is pair the data model
Big Table: Data Model is ext

Tuesday, May 13, 2014

Website URLS

https://ideone.com/ -- Editor for all programming languages
https://redhoop.com/ -- Tutorials and video lectures
https://www.healthkartplus.com/ -- for tablets info mediciens

Tuesday, April 1, 2014

Cassandra

JAVA_HOME=/usr/java/jdk1.7.0_45
PATH=$PATH:$JAVA_HOME/bin/

export JAVA_HOME
export PATH



sudo update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk1.7.0_45/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk1.7.0_45/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/java/jdk1.7.0_45/bin/javaws" 1
sudo update-alternatives --set java /usr/java/jdk1.7.0_45/bin/java
sudo update-alternatives --set javac /usr/java/jdk1.7.0_45/bin/javac
sudo update-alternatives --set javaws /usr/java/jdk1.7.0_45/bin/javaws


CREATE KEYSPACE message
         WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 1};



CREATE TABLE UserActivity (
  userid text,
  txntime timeuuid,
  instid int,
  insttype text,
  txnamount int,
  txncounter int,
  txntype text,
  PRIMARY KEY (userid, txntime)
)

CREATE INDEX instId ON useractivity (instid);
CREATE INDEX instType ON useractivity (insttype);
CREATE INDEX txntype ON useractivity (txntype);

INSERT INTO UserActivity(userId, txntype, instId, instType,txntime,txnAmount,txnCounter)
VALUES ('1', 'LOAD', 1, 'CC',now(),100,1);
INSERT INTO UserActivity(userId, txntype, instId, instType,txntime,txnAmount,txnCounter)
VALUES ('1', 'LOAD', 1, 'CC',now(),100,1);

INSERT INTO Counter(userId, txntype, instId, instType,txntime,txnAmount,txnCounter) VALUES ('1', 'LOAD', 1, 'CC',now(),100,1);


 select * from useractivity where userid='1404' and txntype='LOAD' and insttype='DC' and txntime>minTimeuuid('2013-08-08 18:43:58+0530') and txntime<= maxTimeuuid('2014-01-08 18:43:58+0530');

select * from useractivity where userid='1404' and txntime>minTimeuuid('2013-08-08 18:43:58+0530') and txntime<= maxTimeuuid('2014-01-08 18:43:58+0530');


select value from UserActivity where userid = '" + key + "' and txntime < maxTimeuuid('2014-01-10 00:05+0000') AND txntime > minTimeuuid('2013-01-10 10:00+0000');

select value from UserActivity where userid = '100' and txntime < maxTimeuuid('2014-01-10 00:05+0000') AND txntime > minTimeuuid('2013-01-10 10:00+0000');

Thursday, February 6, 2014

Windows Commands

Setting the IP Address via command Line

netsh int ip set address "local area connection" static 10.10.11.224 255.255.254.0 10.10.10.1 1
netsh int ip set dns "local area connection" static 10.10.10.253 primary    
netsh interface ip add dns name="Local Area Connection" 10.10.10.6 index=2

Resting the IP Address via command Line

netsh interface ip set address "Local Area Connection" dhcp
netsh interface ip set dns "Local Area Connection" dhcp