Friday, February 11, 2011

How to find out CentOS's version

$ cat /etc/issue
CentOS release 5.7 (Final)
Kernel \r on an \m

$ cat /etc/centos-release
CentOS release 6.3 (Final)

$ uname -a
Linux cle-dev 2.6.18-274.18.1.el5 #1 SMP Thu Feb 9 12:45:44 EST 2012 x86_64 x86_64 x86_64 GNU/Linux

$ rpm -qa | grep ^centos
centos-release-notes-5.7-0
centos-release-5-7.el5.centos

$ yum list installed |grep ^centos
centos-indexhtml.noarch
centos-release.x86_64 6-3.el6.centos.9  @anaconda-CentOS-201207061011.x86_64/6.3

# Find out what package were installed with 'yum'
$ yum list installed

# e.g. mysql-server
$ yum list installed |grep ^mysql-server
mysql-server.x86_64   5.1.61-4.el6      @base

# e.g. php modules
$ yum list installed |grep ^php
php.x86_64            5.3.3-14.el6_3    @updates
php-cli.x86_64        5.3.3-14.el6_3    @updates
php-common.x86_64     5.3.3-14.el6_3    @updates
php-gd.x86_64         5.3.3-14.el6_3    @updates
php-intl.x86_64       5.3.3-14.el6_3    @updates
php-mbstring.x86_64   5.3.3-14.el6_3    @updates
php-mysql.x86_64      5.3.3-14.el6_3    @updates
php-pdo.x86_64        5.3.3-14.el6_3    @updates
php-soap.x86_64       5.3.3-14.el6_3    @updates
php-xml.x86_64        5.3.3-14.el6_3    @updates
php-xmlrpc.x86_64     5.3.3-14.el6_3    @updates


Tuesday, November 2, 2010

How to Set up The Grinder 3 for Load Testing

Basic Requirement
  1. Download and install Jython
  2. Install Jython by running this command:
    java -jar jython_installer-2.5.1.jar

How to Start The Grinder

  1. Create a grinder.properties file. (You could simply copy from grinder/examples/grinder.properties.)
  2. Set CLASSPATH to include grinder.jar
  3. Start the Console:
        java net.grinder.Console
    
  4. For each test machine, do Steps 1 and 2, and then start the Agent process:
        java net.grinder.Grinder [grinder.properties]
    
If you are getting this warning message: "can't create package cache dir", make changes to grinder.properties to look like this:
    grinder.jvm.arguments: -Dpython.cachedir=/tmp

Use command line for developing

Edit grinder.properties with these settings:
    grinder.runs = 1
    grinder.useConsole = false

TCPProxy

To find out the default proxy settings in TCPProxy:
$ export CLASSPATH=/opt/grinder/lib/grinder.jar

$ java net.grinder.TCPProxy
12/7/10 2:02:58 PM (tcpproxy): Initialising as an HTTP/HTTPS proxy with the
parameters:
   Request filters:    EchoFilter
   Response filters:   EchoFilter
   Local address:      localhost:8001
12/7/10 2:02:58 PM (tcpproxy): Engine initialised, listening on port 8001

Now, set your browser to use proxy with the above port settings.

To start the TCPProxy Console:
$ java net.grinder.TCPProxy -console -http > grinder.py

Sunday, October 10, 2010

Analyse Disk Activities in Linux

To see disk activities, you can simply issue this command:
# e.g. on /dev/sda
$ cat /sys/block/sda/stat
626485464 806972148 28053848010 1557001361 853157995 3445307000 34392097768 2090234158        0 444939685 3653907428

Using iostat:
# Display every 5 seconds
$ iostat -xm -d 5

# Display on one disk
$ iostat -p /dev/sda -d 5