Categories
Performance Testing

Jmeter Problems and Solutions

1) How to handle sessions in Jmeter?

Add->Pre-Processors->HTTP URL Re-writing Modifier for the sampler where your session variable is present
Then add your variable in session argument name and check cache session id.
Please see the image below:

Jmeter_SessionHandling

2) How to customize the user data/ how to run the script for multiple users in Jmeter?

i) Add Thread Group->Config Element-> CSV Data config Element
ii) Give user variables for the csv file column.
iii) Place the CSV in the same folder where you kept the JMeter script or give full file path in the filename, see the images below:

Jmeter_CSV1

Jmeter_CSV

3) How to run the Jmeter for more than 300 users?

i) Run in Non-GUI distributed mode to run for more than 300 users. It depends on the RAM size. For the system with 3.2 GB, you can run up to 1000 users.

Step1:
Configure Jmeter for Distributed testing

Step2:
Place your script and CSV in /bin folder of the JMeter.

Step3:
Open a command prompt, go to JMeter bin directory and give the following command

jmeter -n -t testplan.jmx -R ip1,ip2 -l resultfilename

4) How to record Jmeter script?
you can capture headers and parameters of the request by Fiddler or HTTPWATCH and write the script manually, or configure proxy and use Recording controller.

A detailed manual is available on Apache Site:
http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf

5) How to extract the data using regex in Jmeter?

There is an element called preprocessor->regularexpression.

Add it under the request you want and then follow the below steps:

i) Give reference name (any name, that will be substituted in the place of an actual parameter value in the request)

ii) Give the regular expression, for example, if the text to be extracted is ‘world’ from text=’world’, then the regex will be like this text='(.+?)’

iii) Give template as $1$

iv) Match No would be which row of the value from the web page, it may be 1, 2,3, etc. If you want a random row then give ‘0’

v)Default value is a string that will be sent to the server when it fails to extract the data. it can be anything for Ex: Loginid_Failed

Please see the image below:

Jmeter_Regex

6) what are the characters used in regex?

Regular Expressions use certain characters and those have special meaning. The following are the list of such characters.
( ) : grouping
[ ] : character classes
{ } : repetition
* + ? : repetition
. : wild-card character
: escape character
| : alternatives
^ $ : start and end of string or line

7) How can I use special characters with actual meaning in regex?

Add backslash to the special character to mean it as it is, for example (),$,^.

8)  Mention example for regular expression to extract string with whitespace

Regular Expression : <url.values+(.+?)=”(.+?)”

Explanation:

<url.value    : Extract the string <url.value

<url.values  : Extract the string <url.value followed by white space

<url.values+Extract the string <url.value followed by white space and

<url.values+(.+?) : Extract the string <url.value followed by white space and any character with 1 or more match

<url.values+(.+?) =  : Extract the string <url.value followed by white space and any character with 1 or more match with equals symbol 

<url.values+(.+?) =”(.+?)” : Extract the string <url.value followed by white space and any character with 1 or more match with equals symbol  and any charcter with 1 or more matches inside double quotes.

So the final string returned from the above condition maybe like this:

<url.value groupid=”1234trurbd93737″

9) How to use java program inside Jmeter?

Java program can be called inside JMeter by using BeanShell Pre/Post Processor.

10) How to send files with Jmeter script?

There is a column in HTTP request as ‘ Send Files with the Request’

Give the file path, parameter name, and MIME type.

For sending different files, give it in CSV file and add the variable in CSVconfig Element. (Any question related to this, you can post your questions)

11) How to capture Jmeter results?

There are a lot of graphs/listeners available for JMeter. Or if the purpose is to find response time for the request, use ‘Aggregate Report’ and take a min, max, avg timings(in milliseconds). That will help a lot.
Or you can download a plugin for colorful graphs.

http://code.google.com/p/jmeter-plugins/

Jmeter_AggregateReport

12) How to View the results of the JTL file created in NON-GUI mode?
Open any Jmeter script, go to Aggregate report listener, Browse the file and Open it. After that, you can save it as a CSV file.

13) How to test ‘HTTPS’ applications using Jmeter?
In HTTP Request default, mention the protocol as ‘https

14) How to rectify Jmeter out of memory error-heap space when opening Jmeter?
Right Click and Edit Jmeter.bat file, increase Xmx value, and check.

15) Where to Download Jmeter latest version?
https://jmeter.apache.org/download_jmeter.cgi

16) How to execute the ssh command or shell script on a remote server using Jmeter?
Using SSH sampler it can be done. For a detailed explanation see here
https://www.technix.in/execute-linux-command-shell-script-apache-jmeter/

17) How to run an endurance test using Jmeter for more than 8 hours?

Using Timers, it is possible to run endurance test using JMeter, please look at this

https://www.technix.in/run-overnight-endurance-test-consecutively-using-jmeter/

Categories
Performance Testing

Performance Testing on ETL

How to do performance testing on ETL?

1) First step , find out the load that is being transformed in production
2) Create new data of that same load or Move from Production data to your local performance server
3) Disable the ETL until you generate the load required
4) Take count of the needed data from the tables of the database
5) Note down the last run of ETL and Enable the ETL ,so that it will get enough stress to
transform entire load created ,run it.
6) After ETL completes the run ,again take count of the data created /transformed
a) Note down ETL Run time End and find out the total time it took to tranform the load
b) Findout whether performance time is improved or decreased
b) See that all the expected load got extracted and transfered witETL_Process_Flowhout missing.

Categories
Performance Testing

How to find RAM utilization for specific JAVA process at run time

How to find RAM utilization for specific JAVA process at run time when application is running with huge load?

1) Open terminal in your Linux server.

2) Set your JAVA_Home.

3) type as jconsole and Enter

4) You can see a new window opening with jconsole, select the process that you want to profile and click on connect

jconsole

 

5) This will show show all details included Heap memory,Non heap memory,No. of loaded classes,No. of Live threads

what is the advantage of using jconsole?

If you want to see the summary of resource utilization in the production server at run time, this is the right tool to use as it will not create much performance overhead on the server . 

 

Categories
Linux technews testing

Installing Java and Setting JAVA_HOME

For any applications built around java requires JAVA_HOME variable to be set, here is how to setup JAVA_HOME for both Linux/Unix and windows environment.

To Install the JDK Software and Set JAVA_HOME on a UNIX System

  1. Install the JDK software.
    1. Go to http://java.sun.com/javase/downloads/index.jsp.
    2. Select the appropriate JDK version and click Download.The JDK software is installed on your computer, for example, at /usr/jdk/jdk1.6.0_02. You can change this location.
  2. Set JAVA_HOME.
    • Korn and bash shells:
      export JAVA_HOME=jdk-install-dir
      export PATH=$JAVA_HOME/bin:$PATH
    • Bourne shell:
      JAVA_HOME=jdk-install-dir
      export JAVA_HOME
      PATH=$JAVA_HOME/bin:$PATH
      export PATH
    • C shell:
      setenv JAVA_HOME jdk-install-dir
      setenv PATH $JAVA_HOME/bin:$PATH
      export PATH=$JAVA_HOME/bin:$PATH

To Install the JDK Software and Set JAVA_HOME on a Windows System

 

  • Install the JDK software.
    1. Go to http://java.sun.com/javase/downloads/index.jsp.
    2. Select the appropriate JDK software and click Download.The JDK software is installed on your computer, for example, at C:Program FilesJavajdk1.7. You can move the JDK software to another location if desired.
  • Set JAVA_HOME:
    1. Right click My Computer and select Properties.
    2. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:Program FilesJavajdk1.7.

JAVA_windows

Categories
Databases Errors Linux oracle

ORA-00845: MEMORY_TARGET not supported on this system

Getting ORA-00845: MEMORY_TARGET not supported on this system, while trying to start a database.

Error
sql> startup
ORA-00845: MEMORY_TARGET not supported on this system

Reason:

This is a very common error which you might face while starting up your oracle database. This happens when your system is out of temporary storage. While starting up the database oracle uses /dev/shm to store temporary files but when it runs out of memory you get this error.

/dev/shm is also know as tmpfs i.e. temporary file system which keeps all the file system in virtual memory to speed up several processes.

Solution:

Increase the size of /dev/shm

To check the size of /dev/shm
root@localhost# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 10G 4.4G 2.9G 61% /
tmpfs 504M 76K 504M 1% /dev/shm
/dev/sda1 194M 25M 160M 14% /boot

To increase the size
root@localhost# mount -o remount,size=3G /dev/shm
Verify the size
root@localhost# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 7.6G 4.4G 2.9G 61% /
tmpfs 3G 1007M 2.1G 33% /dev/shm
/dev/sda1 194M 25M 160M 14% /boot

To make permanent changes to your file system update your fstab
root@localhost# vi /etc/fstab
tmpfs /dev/shm tmpfs defaults,size=3G 0 0

 

Update the new fstab file
root@localhost# mount -a
 

Categories
Linux technews

Linux kernel 3.9 released

Linux-Kernel-3-3Linux creator Linus Torvalds has released version 3.9 of The Linux Kernel. This release has done nearly ten weeks after 3.8 version was released. The latest release of 3.9 can be obtained from Kernel.org.

Protocol           Location

HTTP                https://www.kernel.org/pub/

FTP                  ftp://ftp.kernel.org/pub/

RSYNC             rsync://rsync.kernel.org/pub/

Here is a quick look into new features of Linux released

  1. SSD caching: Linux 3.9’s addition of a device mapper target (dm-cache) that enables the usage of speedy devices such as solid-state drives(SSDs).
  2. Expanded Architecture support: This new release brings support for ARC700 processor family (750D & 770D) from Synopsys as well as the META ATP (Meta 1) and HTP (Meta 2) processor cores from imagination. Meta cores can be found in many digital radios, while the ARC700 family is commonly embedded in SoCs in TC set-top boxes and digital media players.
  3. Better Power efficiency: Thanks to the inclusion of intel PowerClamp driver, which performs synchronised idle injection across all online CPUs.
  4. Chromebook Support: Support for all most all chrome books supported by different vendors.
  5. Another Boost for ARM: Linux’s support for ARM has improved considerably over the past few releases, and kernel 3.9 brings a key improvement in the form of support for the KVM virtualization system in the ARM architecture port. As KernelNewbies notes, “this brings virtualization capabilities to the Linux ARM ecosystem.”
  6. Android developer Support: Linux 3.9 adds support for the “Goldfish” virtualized platform that’s part of the Android development environment. Essentially, that means it’s now possible to develop for Android with “out-of-the-box” kernels.

Of course, this is only a small sampling of what’s new in Linux 3.9; a raft of new drivers and numerous other new improvements are included as well. A thorough summary is available on The H.