Thursday, August 12, 2010

Load Tests using JMeter

Create Test Plan in JMeter
JMeter Documentation is available here

Discussion on Different Load Testing Tools

Brain Dumps are available here
Setup of EC2 Clients
  1. Create a key-pair and copy it to your Linux Machine.
  2. Rename it as rsa-gsg-keypair(optional).
  3. Change Permissions using

    chmod 600 rsa-gsg-keypair
  4. Launch an EC2 instance from Amazon Console
  5. User guide for EC2 clients is available here
  6. Get the Public DNS Name of the instance.
  7. Now Log-in to the Instance using

    ssh -i id_rsa-gsg-keypair root@xxx.amazonaws.com
  8. If required change Client's Time Zone to GMT using

    unlink /etc/localtime
    ln -sf /usr/share/zoneinfo/GMT /etc/localtime
  9. Download JMeter using


    wget http://mirrors.axint.net/apache/jakarta/jmeter/binaries/jakarta-jmeter-2.4.tgz
  10. Install JMeter


    tar –xzf jakarta-jmeter-2.4.tgz
  11. Set path to JMeter


    export PATH=$PATH:/path_to_jmeter_bin_directory
  12. Download and install Java Runtime Environment (JRE)
  13. Get Load test Plan (jmx file of JMeter onto this client)
  14. Increase Open files limit using

    ulimit –n 8192
  15. Run Load test using

    jmeter.sh -n -t M2LoadTests.jmx -l sample.jtl -j sample.log
  16. Copying JMeter results (jtl files) on half hourly intervals make crontab entry as

    */30 * * * * /bin/cp /root/sample.jtl /root/Client-1-`/bin/date +"%Y-%m-%d-%H-%M"`.jtl
JMeter as a Service
Information on JMeter as a Service is available here

Home Work (Benchmarking)
  1. Host a simple "Hello world" HTML Page on the server on which you are going to perform Load tests
  2. Try to perform load tests by hitting "Hello World" Page using 2 clients. (500 Threads from each client)
  3. Increase number of threads by increasing no. of clients.
  4. Keep on plotting results in a graph.
  5. If it is a straight line then some thing is wrong with your setup like webserver setup (look at webserver conf file)
  6. If it is some kind of Curve shooting up then wait for a U-Turn in the curve.
  7. Get Numbers related to Latencies at this U-Turn and consider them as lowest Latencies with given setup.
  8. Get Numbers related to Throughput at this U-Turn and consider them as highest Throughput one can achieve with given setup.
  9. Also get average network latency for 100 pings using traceroute. This will be the minimum Network Latency.
Key parameters to be captured

  1. Processor Utilization


    dstat with -cp switch
  2. Memory utilization


    dstat with -m switch
  3. Disk utilization


    dstat with -d switch
  4. Network utilization


    dstat with -n switch

Points to Remember
  1. Servers should not be put behind Load Balancer
  2. Install dstat if required using


    emerge -av dstat if it is Gentoo



    yum if is RHEL
  3. Monitor Server side System Resources using


    dstat -cndymlp -N total -D total -l --output SystemMon.csv

No comments:

Post a Comment