Wednesday, 19 December 2012

Hot deploy in jboss

https://community.jboss.org/wiki/JBoss51DisableEnableHotDeployHDScanner

Wednesday, 7 November 2012

DB Oracle Important Stats to monitor

1) Buffer Cache hit ratio. This should be high as the  data is needs to be read from cache. Also the disk i/o is less if it is read from cache.
2) Cache hit ratio
3) Library cache.. where sql,pl/sql, re-usable sql are placed
4)soft parsing should be high compared to hard parsing... as the time spent in parsing sqls is less softparsing. (Softparsing->hardParsing->Explain plan)

Sunday, 4 November 2012

jmx-console

http://www.blogsoncloud.com/jsp/blogs/using-jboss-jmx-console.jsp

Monday, 29 October 2012

Sunday, 28 October 2012

Saturday, 27 October 2012

Sunday, 14 October 2012

Apache MPM Prefork vs Worker

https://communities.ca.com/web/ca-identity-and-access-mgmt-distributed-global-user-community/message-board/-/message_boards/view_message/98290538

This Tuesday Tip will cover some common questions regarding Apache, specifically prefork vs. worker mode, how to change the default value on RedHat, Solaris and other operating systems as well as verifying what mode apache is currently running in.

A. The default MPM for Unix is the Prefork module. 
B. The Worker MPM was introduced in Apache2. 

Now Comparing between Worker MPM and Prefork MPM.

Prefork MPM 
- prefork MPM uses multiple child processes with one thread each. 
- Each process handles one connection at a time and uses more memory. 
- Good for non-thread-safe third party modules. 

Worker MPM 
- worker MPM uses multiple child processes with many threads each. 
- Each thread handles one connection at a time. 
- Good for high-traffic, smaller memory footprint. 

MPM uses a multi-process and multi-threaded structure. 
Multi-process --> multi PIDs (use 'ps -aef' to find out) 
Multi-thread --> more connections per PID. (use 'lsof' (on Solaris) to find out. 'netstat -an' (You really won’t see everything.) 

The worker MPM uses multiple child processes. It's multi-threaded within each child, and each thread handles a single connection. Worker is fast and highly scalable and the memory footprint is comparatively low. It's well suited for multiple processors.

Prefork MPM is preferred for better compatibility with older software or for better stability although it uses more memory. It handles requests in a manner similar to Apache 1.3. It is appropriate for sites that need to avoid threading for compatibility with non-thread-safe libraries. It is also the best MPM for isolating each request, so that a problem with a single request will not affect any other. Prefork is well suited for single or double CPU systems, speed is comparable to that of worker, and it's highly tolerant of faulty modules and crashing children - but the memory usage is high, and more traffic leads to greater memory usage.

Conclusion: For most new websites that are that use thread safe libraries, use multiple processes and high traffic sites, CA SiteMinder recommends MPM worker mode for Apache.

>>>>>>>>>>>

How to tell if I’m running Apache in prefork or worker MPM? (Multi-Processing Module)

Note : You can have one and only one MPM module loaded in apache at any one time. 

From the bin directory, you can run ./apachectl -V (Capital V)

./apache2/bin/apachectl -V
Server version: Apache/2.0.50
Server built: Aug 3 2004 16:52:20
Server's Module Magic Number: 20020903:8
Architecture: 32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork" (This is running in prefork mode)

Newer version running in worker mode:

./apachectl -V
Server version: Apache/2.2.21 (Unix)
Server built: Oct 23 2011 17:42:11
Server's Module Magic Number: 20051115:30
Server loaded: APR 1.4.5, APR-Util 1.3.12
Compiled using: APR 1.4.5, APR-Util 1.3.12
Architecture: 32-bit
Server MPM: Worker <------Worker
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/worker" <- This same line will still exist.


A second way to check, again from the bin directory:

#./ httpd -l 
Compiled in modules: 
core.c 
prefork.c <---- Prefork
http_core.c 
mod_so.c

./httpd -l
Compiled in modules:
core.c
mod_access.c
mod_auth.c
mod_include.c
mod_log_config.c
mod_logio.c
mod_env.c
mod_setenvif.c
worker.c <-----Worker

>>>>>>>>>>>

How do I change the default value on RHEL (Red Hat Enterprise Release)?

Edit the /etc/sysconfig/httpd file.

Change #HTTPD=/usr/sbin/httpd.worker

to

HTTPD=/usr/sbin/httpd.worker

and stop/start the apache service.

>>>>>>>>>>>

Solaris or most unix like operating systems.

When I download the code from apache.org and use certain flags to compile apache, what flag do I use for worker mode?

./configure --with-mpm=worker

For all compile options, please reference www.apache.org

Apache Bench results for prefork:
Requests per second: 20.91 [#/sec] (mean)

Apache Bench results for prefork:
Requests per second: 40.94 [#/sec] (mean)





How to install Worker MPM:
http://kmaiti.blogspot.in/2012/02/how-to-start-apache-uisng-worker-mpm.html

http://articles.slicehost.com/2010/5/19/configuring-the-apache-mpm-on-centos


http://www.virtualmin.com/node/15046
http://articles.slicehost.com/2010/5/19/apache-configuration-files-on-centos
http://articles.slicehost.com/2010/5/19/configuring-the-apache-mpm-on-centos


Apache Prefork VS Worker MPM

https://communities.ca.com/web/ca-identity-and-access-mgmt-distributed-global-user-community/message-board/-/message_boards/view_message/98290538

Thursday, 4 October 2012

Wednesday, 19 September 2012

Rest Tutorial

http://rest.elkstein.org/2008/02/more-complex-rest-requests.html

JBOSS Thread Pools Description

http://zeroproductionincidents.wordpress.com/tag/ajp-thread-pool/

Tuesday, 14 August 2012

Monday, 25 June 2012

Vim editor for timestamp

vim editor regex to update timestamp in jmeter results file
:%s/2012-\d\d-25/2012-02-25/g

Wednesday, 6 June 2012

sqlplus output to file with out display and trims on

http://blog.niklasottosson.com/?p=761

http://stackoverflow.com/questions/6813210/oracle-sqlplus-saving-output-in-a-file-but-dont-show-on-screen



SET echo off
02SET feedback off
03SET linesize 100
04SET pagesize 0
05SET sqlprompt ''
06SET trimspool on
07SPOOL filename.csv
08 
set Termout off
09SELECT field1 || ',' || field2 || ',' || field3 FROM tablename;
10 
11SPOOL off
12exit
st

Wednesday, 30 May 2012

Linux imp commands

http://www.fromdev.com/2008/12/debugging-java-on-unixlinux-my-favorite.html

Tuesday, 29 May 2012

TCP Network analysis

http://www.cyberciti.biz/tips/linux-investigate-sockets-network-connections.html



Determine Threads with High CPU usage

http://blogs.manageengine.com/appmanager/2011/02/09/identify-java-code-consuming-high-cpu-in-linux-linking-jvm-thread-and-linux-pid/

Convert Decimal to hexaecimal:
http://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html



Friday, 25 May 2012

Webserver precompress static files

http://mark.aufflick.com/blog/2007/12/06/serve-pre-compressed-content-with-apache



Saturday, 5 May 2012

Wednesday, 2 May 2012

Tuesday, 17 April 2012

Thread Analysis

grep "\- waiting on" filename | awk '{print $4;}'|sort | uniq -c

cat API_100_0417_1|grep java.lang.Thread.State| awk '{print $2;}'|sort | uniq -c



Monday, 16 April 2012

Generate AWR Report


  1. su – oracle
  2. sqlplus “/ as sysdba”
  3. SQL> @$ORACLE_HOME/rdbms/admin/awrrpt.sql

Thursday, 29 March 2012

responsetime from webserverlogs

cat access_log.2012-03-29|awk '{print $7, $20}'| sed 's/\/[^a-z]/ /g'

Monday, 12 March 2012

sqlplus install error resolution

http://www.yoursearchbuddy.com/sqlplus-error-loading-shared-libraries-libsqlplusso

the above solution is for the following error:
./sqlplus: error while loading shared libraries: libsqlplus.so

Wednesday, 7 March 2012

Saturday, 3 March 2012

TCP_DUMP

http://www.alexonlinux.com/tcpdump-for-dummies


tcpdump -ni eth1 -w file.cap -s 0 -c 1000 not port 22

Sunday, 19 February 2012

Thread Contentions

Free Memory in Linux

Actual Free Memory in Linux = Free+ Buffer+Cache

Linux uses RAM to load the Disk data in RAM (emory) as reading data from memory is faster. As the needs for memory to other process increases it shrinks the cahced data accordingly.

http://blog.scoutapp.com/articles/2010/10/06/determining-free-memory-on-linux

Saturday, 11 February 2012

calculate avg and 90th percentile from awk command



Average:
cat <filename> |grep HOME|grep "Number of samples"|awk -F "," '{sum+=$2} END { print "Average = ",sum/NR}'


95th Percentile:
cat <filename> |grep HOME|grep "Number of samples"|awk -F "," '{print $2}' |sort -n|awk 'BEGIN{i=0} {s[i]=$1; i++;} END{print s[int(NR*0.95-0.5)]}'

Friday, 10 February 2012

calculate avg of a column


awk '{ s += $1 } END { print "sum: ", s, " average: ", s/NR, " samples: ", NR }' rails_production_log_or_whatever.log

Friday, 3 February 2012

AWk command to cut a big file into small files at a repeatative word

awk '/selected./{n++}{print >"out" n ".txt" }' partitionbased_cc_acc_ids.txt

here "selected." is the repeatative word..

Tuesday, 31 January 2012

Data_partitioning for scale

http://java-persistence-performance.blogspot.in/2011/05/data-partitioning-scaling-database.html

http://databasewisdom.com/partit_ora1.shtml


Awesome:
http://www.shutdownabort.com/dbaqueries/Structure_Partitions.php

Monday, 30 January 2012

Oracle sql tuning

http://www.credmond.net/oracle/tuning/
http://www.myoracleguide.com/s/OracleTips.htm

How to get the list of sqls that are CPU intensive and Waiting
http://uhesse.wordpress.com/2010/07/08/performance-monitoring-active-session-history-at-work/

Monday, 16 January 2012

remove lines in a file in Linux

sed '1,10d' server.log
command to remove lines between the line numbers 1 and 10..

http://en.kioskea.net/faq/1451-sed-delete-one-or-more-lines-from-a-file

Extract rows from a file unique w.r.t column


awk '!_[$1]++' filename
Here rows are extracted w.r.t unique values from column 1.

Monday, 9 January 2012

Thursday, 5 January 2012

Tuesday, 3 January 2012

GEt Dbname in oracle


SQL> SELECT VALUE FROM V$PARAMETER WHERE NAME='db_name';

VALUE
--------------------------------------------------------------------------------
XXXXXXX

Oracle Connect as sysdba error..


SQL> conn / as sysdba
ERROR:
ORA-12162: TNS:net service name is incorrectly specified


SQL> exit
[qysprffinwkdb01:/home/oracle](Perf)% export ORACLE_SID=xxxxxx
[qysprffinwkdb01:/home/oracle](Perf)% echo $ORACLE_SID
xxxxxx
[qysprffinwkdb01:/home/oracle](Perf)% sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.5.0 - Production on .........

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL>

Jmeter starting from Command line

http://jmeter.apache.org/usermanual/get-started.html

Monday, 2 January 2012

AWk command for .csv files

http://stackoverflow.com/questions/7857090/awk-extract-specific-columns-from-delimited-file