Error -26547: Authentication required, please use web_set_user in LoadRunner

Action.c(12): Error -26547: Authentication required, please use web_set_user, e.g. web_set_user("domain\\user", "password", "host:port"); [MsgId: MERR-26547]
After adding the web_set_user() as suggested in the error message a further error is received:
Error -26630: HTTP Status-Code=401 (Access Denied) for "http://" [MsgId: MERR-26630]
LoadRunner does not currently support Microsoft Distributed Password Authentication (DPA)
To determine if DPA is being used in the generation log look at the header in the Server response to the initial GET. The following is an example server response:
HTTP/1.1 401 Access Denied\r\n
Server: Microsoft-IIS/5.0\r\n
Date: Fri, 15 Jan 2010 11:07:04 GMT\r\n
WWW-Authenticate: DPA\r\n
Content-Type: text/html\r\n
Cache-Control: proxy-revalidate\r\n
Content-length: 616\r\n
Proxy-Connection: Keep-Alive\r\n
Connection: Keep-Alive\r\n
Proxy-support: Session-based-authentication\r\n
Note the WWW-Authenticate:DPA
There is currently no workaround available

After adding a permanent license in LoadRunner 11.50 the Controller crashes when it is opened

When adding a permanent license in Load Runner 11.50 License Utility the license is displayed correctly. However, when opening the Controller it crashes silently and it is not possible to use it.

The length of one or more of the license keys applied in the License Utility is too big and the Controller is not able to handle it correctly.

The issue is resolved in LoadRunner Service Pack 11.51.

Try the following:

  1. Open Windows Explorer and navigate to “%AllUsersProfile%\Application Data\HP\LoadRunner\data",
  2. Open file LRKey.txt and then 
  3. Remove the content in double quotes ("") in all occurrences in the file and save the changes. These are the license key descriptions. Removing them makes the keys shorter,
  4. Finally Open the Controller.

VuGen does not launch any applications while recording

Turn off Data Execution Prevention in Windows

If this problem occurs with every application that it tries to launch, make sure Data Execution Prevention is turned off. To find Data Execution Prevention:
1. Right-click on My Computer, and choosing Properties.
2. Select the Advanced tab, and click on Performance, then Settings.
3. Select the Data Execution Prevention tab, and make sure the first option is selected which is “Turn on DEP for essential Windows programs and services only.

License Manager was not initialized

In the Controller when running a test if the following error is shown : Error Message "License Manager was not initialized"
The reason for this error to occur is because the user account doesn’t have the required permissions to initialize the LoadRunner libraries and interact with the operative system.
Be sure that you are using a full Administrator account over the machine where the Controller is installed. Any other permissions group will affect the load test.
Completely disable the DEP and reboot the machine.
Open an Elevated Command Prompt
i. Open the Start Menu
ii. Click All Programs and Accessories
iii. Right click on Command Prompt and click Run as Administrator
iv. Click on Continue
To Disable DEP
i. In the Elevated Command Prompt, type:
bcdedit.exe /set {current} nx AlwaysOff
ii. Restart the computer to apply

What is the relation between Response Time and Throughput?

The Throughput graph shows the amount of data in bytes that the Vusers received from the server in a second. When we compare this with the transaction response time, we will notice that as throughput decreased, the response time also decreased. Similarly, the peak throughput and highest response time would occur approximately at the same time

How did you plan the Load? What are the Criteria?

Load test is planned to decide the number of users, what kind of machines we are going to use and from where they are run. It is based on 2 important documents, Task Distribution Diagram and Transaction profile. Task Distribution Diagram gives us the information on number of users for a particular transaction and the time of the load. The peak usage and off-usage are decided from this Diagram. Transaction profile gives us the information about the transactions name and their priority levels with regard to the scenario we are deciding.

Analysis Scenario (Bottlenecks)

In Running Vuser graph correlated with the response time graph you can see that as the number of Vusers increases, the average response time of the check itinerary transaction very gradually increases. In other words, the average response time steadily increases as the load increases. At 56 Vusers, there is a sudden, sharp increase in the average response
time. We say that the test broke the server. That is the mean time before failure (MTBF). The response time clearly began to degrade when there were more than 56 Vusers running simultaneously.

How many types of graphs does LoadRunner have?

LoadRunner has in total 5 different types of flag which are as follows:
The Hits per second graph that depicts the traffic volume of the application being tested for.
Pages download per second graph shows the rate at which the download processes are carried out at a particular instance of time.
The Transaction response time (load )
The Transaction response time (percentile) graph
Network delay time graph shows the time elapsed for the request/ response activities in the application

What is injector in LoadRunner?

Injectors can also be called as load generators in LoadRunner. In order to create multiple Vuser script it is essential to create a scenario where the load generator has to be specified first. This provides vital host information such as it is local or remote host. The load generators must add the IP addresses of the participating machines from where the Vusers are assimilated to run scripts but prior to that the load generator must be installed in them as they are to be used as injectors

what is pacing?

Pacing is also like a wait but it is used to time count between two iteration.

Pacing is nothing but scheduling the next iteration.It consist of options:

1.as soon as previous iteration

2.start iteration with delay


Embedding Pacing In LoadRunner Script (Includes Pacing For Blocks Too)

We come accross many pacing logics in the LoadRunner script which is based on the multiple iterations. But if we need to have a pacing if there are Action blocks involved and if in case we need to re-calculate the pacing time after each iterations (which will be a good idea) as few iterations may not take the same time to execute in the LoadRunner Script, then, we need to implement a different Pacing Logic. Here it is.......
The below pacing logic calculates the pacing time after completion of each iterations and based on the test duration left.

This pacing logic have three different functions embedded in a .C function File.
1. InitCore()
2. TopOfIterations()
3. BottomOfIterations()

1. InitCore():
The InitCore() Function takes 3 parameters as mentioned in the below syntax:
InitCore(TestDuration(in Seconds), TotalBlockIterations, MaxNumberOfIterations);
Example: InitCore(180, 12, 2); - Script will execute for 24 iterations and for 180 seconds [i.e. 3 Min]
Refer the below screen for more understanding:

So, in this case the Total Number Of Iterations becomes 24 [TotalNoOfIterations = TotalBlockIterations + MaxNumberOfIterations].
This InitCore Function should be the first line in vuser_init section.

2. TopOfIterations():
This function calculates the Pacing Time based on the Test Duration and Total Number Of Iterations which will be used for the actual pacing time in the main script. This Function Call should be the first line in the Main Action Block.

3. BottomOfIterations():
This function does the main calculations of the Pacing Time when a Block Execution is completed based on the Test Durations left and the Total Number of Iterations left. This is same as re-calculating the Pacing Time instead of fixed Pacing Time each time the iterations is completed. Please note, here each BLOCK execution is considered as each ITERATIONS. This Function Call should be the last line in the Main Action Block.

These TopOfIterations() and BottomOfIterations() functions can be added in different Actions Blocks.

Bottleneck:
Since the Pacing Time is calculated based on the Test Durations left and Iterations left, there could be a possibility that few iterations might take long time to finish and if this is the case then at some point of time the Test Durations time becomes 0, in this case the rest of the Iterations are executed without calculating the Pacing Time and hence the Pacing Time becomes 0.

Actual Code Comes Here:double TestDuration, pacing_time, Origpacing_time;
int Counter = 1,MaxCounter = 0, TotalIterations;
merc_timer_handle_t timer;
double duration;

InitCore(double TDuration, int TotalBlockIterations, int MaxNumberOfIterations)
{
TestDuration = TDuration;
TotalIterations = TotalBlockIterations * MaxNumberOfIterations;
}

TopOfIterations()
{
if (Counter == 1) {
lr_output_message("Action1 - Total Test Durations - First Time: %lf",TestDuration);
pacing_time = (double)TestDuration / TotalIterations;
lr_output_message("Action1 - Total Iterations Left - First Time: %d",TotalIterations);
lr_output_message("Action1 - Pacing - First Time: %lf ",pacing_time);
}
}

BottomOfIterations()
{
if ((duration <> 0) {
TestDuration = TestDuration - pacing_time; //Is equal to Pacing time
MaxCounter = 1;
}

TotalIterations = TotalIterations - 1;
if (MaxCounter != 0) {
lr_think_time(pacing_time - duration);
pacing_time = TestDuration / TotalIterations;
MaxCounter = 0;
}
else if (TestDuration > 0) {
TestDuration = TestDuration - duration;
pacing_time = TestDuration / TotalIterations;
}

if (TestDuration <= 0) {
pacing_time = 0;
}
lr_output_message("Action1 - Total Iterations Left: %d",TotalIterations);
lr_output_message("Action1 - Total Test Durations Left: %lf",TestDuration);
lr_output_message("Action1 - New Pacing: %lf",pacing_time);
Counter = 0;

Calculating Processor(_Total)\%Processor Time For System Using Process(*)\%Processor Time Performance Counter

Before going to detailed description on this topic, I would like to start it with a question...!!!!"Can we calculate %Processor Time for the System which has multi-core processor if Processor(_Total)\%Processor Time counter is not included in the Perfmon?" [Also, provided we have all the necessary counters for the Process Object in the Perfmon, for e.g. Process(*)\%Processor Time is included]

Any Guess...!!!!!
Let me tell you how we can do this using the Process(*)\%Processor Time counters for the Process Object.
We can do this by using the following formula which will reflect exactly the same values for the Processor Counter [i.e. Processor(_Total)\%Processor Time]
Use the below formula:
Processor(_Total)\%Processor Time =[Process(_Total)\% Processor Time - Process(Idle)\% Processor Time]/Number Of Cores

Considering Process(_Total)\% Processor Time = Number_Of_Cores * 100

Bit confusing..????
Let me explain you with some example which will give you more understanding on this measurement.
Consider the below raw data which I have from the Perfmon utility every 1 second. I have considered here only 3 performance counters to make you understand:
1. Process(_Total)\% Processor Time
2. Process(Idle)\% Processor Time
3. Processor(_Total)\% Processor Time

Process(_Total)\ % Processor Time  Process(Idle)\ % Processor Time
194.7602101 113.7708158
199.68128 174.72112
196.5612 170.04109
198.12127 174.72112

Processor(_Total)\% Processor Time
43.11458591
12.63944
14.97946
12.63944

Descriptions:
I have a Dual-Core machine, so let me consider the column \\MachineName\Process(_Total)\% Processor Time to evaluate it's values as:

\\MachineName\Process(_Total)\% Processor Time = 2 x 100 = 200 [So we can consider column values of this counter as 200 instead of 194.7602101, 199.68128 and so (this is nothing but the value 100% for each cores).

So, now let me calculate the Processor(_Total)\% Processor Time with the available Process related data.
e.g.
Processor(_Total)\% Processor Time = [200 - 113.7708158]/2
= 43.1145921 (which is almost equal to what it is shown in the third column of the Perfmon result i.e. equal to column values MachineName\Processor(_Total)\% Processor Time)

This explains the procedure to calculate the Processor(_Total)\% Processor Time if in case only Process counters are included in the Perfmon Utility.

Monitoring System Resources On Remote Machines Using PERFMON

We use to monitor the system resources using PERFMON and our machines without any issues, but I faced some different kind of issues while monitoring the remote machines using PERFMON tool from a centralized machine.

Before going into the detail of the PERFMON issues, please ensure few things on your machine where you are going to start the counter logs.
a) Check that Performance Logs and Alerts service is running
b) The service name is SysmonLog and the path to executable is "C:\window\system32\smlogsvc.exe". This service should be running in the services window.

I had 8 machines configured on the same domain and wanted to monitor these machine from a single point centralized machine. The required counters were created using "logman Create" method and to start and stop these perfmon counters I used to have a batch file. (This will monitor system resources on all the 8 machines from the centralized machine.

Now here comes the problem....!!!!

When I started the counter logs, it didn't start collecting data from these 8 machines. The reason for this is that, the user (for this centralized machine) doesn't have access to these machines so the perfmon counter logs were not getting started on these machines and hence the data is not collected.

The solution for this issue is that, after creating the counter logs on the centralized machine to monitor system resources of remote machines, perform the following actions:
1. Open Perfmon window
2. Go to properties of the counter logs (that has been created to monitor the remote machines)
3. On the System Overview properties (in XP, will be different in higher version of OS), type the User Name in the "Run As:" field and click on either "Set Password" or "Change" button (based on the OS version you are using)
4. On the Set Password window, provide the User Name, Password and Confirm Password and click on OK Button

Now, you are all set to monitor the system resources of the remote machine from a centralized machine.

Difference In Monitoring System Resources From Performance Center & Controller

You might have monitored system resources from HP Performance Center or HP LoadRunner Controller application. But any time did you have faced any problem while collecting data (like %Processor Time, pages/sec etc for memory etc).
There is difference in adding measurements from Performance Center & from Controller. Have you ever seen that when you add System IP for collecting data from this IP while executing your scenario, but the data is not collected. I have faced this problem. Let me explain my scenario in this case:
In Performance Center:
1. You create a scenario, add scripts to execute in Design tabs and add the monitors in the Monitors tab (you provide the UserID/Password while adding the performance counters to be monitored on the machine).
2. You start the scenario, and the performance data is collected from this machine.

But do you really think it is so simple if you add performance counters for a machine on HP LoadRunner Controller.
Try adding the performance counter in LoadRunner Controller scenario and start the scenario. You will see that the window resources graph doesn't display the data. (it has happened with me) .
This is due to the fact that, while adding the machine under window resources, it doesn't ask for the system UserID/Password and the LoadRunner Controller machine UserID/Password overrides the UserID/Password of the system which is to be monitored.

So in this case, the password of the Controller machine and the Monitor machine should be same. Then only you can monitor the system resources added in the Controller scenario.

Performance tuning

Let us have some information about tuning concept to be introduced during performance testing. In my scenario, the number of users were supported by the application was only 18. Beyond this number all users were failing to logging with the "Database Related Error". The error that I was getting was "Couldn't create Database Instance". [looks like it is a Database related error]
When I started looking into this issue, we had few areas that we could look for the solution. They were:
1. Connection Pools
2. Tomcat (if tomcat is the Web Server)
3. OS system file
4. Hardware resources

I encountered this issue on Solaris box. I started finding the solution for this issue and below are areas I looked into:

1. I started looking at the Application Server Connection pools issue. We had few parameters in the web.xml file under the middle-tier where min_connex and max_connex parameter was defined related to the Database. These parameters were set to 2 and 5 respectively. The best way to start finding the solutions for any issue is the log that is being written. In the middle-tier log, out of 4, 3 connection pools were always idle. So, there was no problem at the middle-tier side.

2. I tried increasing the tomcat memory from 512MB to 1024MB in catalina.sh file. This didn't resolve the issue.

3. Looked into the /etc/System file on the Solaris OS and saw some parameters like maxusers, maxuproc (maximum user processes). Setting maxusers to a value will control max_nprocs and maxuprc. The algorithms are:
max_nprocs = 10 + (16 x maxusers)
maxuprc = max_nprocs – reserved_procs (default is 5)
Even this setting didn't resolve the issue.

4. last but not the least, I looked into the System resources and found that the root path (i.e. "/") doesn't have much disk space to allocate DB resources any more beyond 18 users. Since the Oracle was setup at "/" path and the Oracle folder wasn't assigned any more system resources, Oracle was utilizing the space allocated to "/". Due to in-sufficient disk space on "/" path, users were not able to make connection with the Oracle DB and hence was failing.
Increasing the root disk space eliminated the issue with the user login.

Hope this was a good article to understand the tuning concept applied before looking into in details of performance tuning.

VUSER CALCULATIONS ?

Calculating How Many Maximum Number Of Users Required If We Need To Achieve 12K Transactions With SLA Of 5 Minutes

Total Number of Transactions to be completed = 12,000
Average Response Time = 5 Minutes

To avoid putting much load on the system I will add 5 Minutes so that to total time taken to complete one iteration will be 10 Minutes. This addition will include the thinktime between the each screen/transaction traverse.

Now, I know each iteration will take 10 Minutes to complete, hence in 60 Minutes only 6 transactions can be completed. i.e. 1 User will do 6 transactions in an hour.

Now how to calculate how many users are required to complete 12,000 transactions in an hour?
The calculation will be:
#Users Required = 12,000/6
= 2000 Users

This way we can find the number of users required if total throughput is provided with an average response time.

Hence to achieve 12,000 transactions I need 2000 Users with 5 minutes of thinktime in between the iterations with an average response time of 5 Minutes.

Hope this post helps you to come-up with a Workload Modelling Concept (a bit). Please do let me know if my assumptions are wrong.

PACING Calculation

Pacing Calculation :

D = Duration of the test(test window/time frame)

B = Baseline time(total time taken by 1 Vu to complete 1 whole iteration)

T = Total amount of Think time in the script

I = Expected/Target iteration

R = Residual time of the test window.

R = ( D - (T + B)*I)

P = Pacing interval

Dividing the residual time by target iteration gives pacing interval

Hence:

P = R/I

D is pacing time.
(T + B)*I represents the duration of a scenario
and P is the waiting time before the next scenario

Calculating Pacing Time/Think Time to achieve 50 TPS with an average response time of 0.5 seconds with total of 100 Users

Let us start with calculating total number of transactions in an hour.
1 sec = 50 trnx
3600 sec = x
x = 3600 * 50 = 180000 trnx/hour by 100 Users

We have total number of users given as 100. Let us see how to calculate how many transactions each user will perform.
Total Number of Users = 100
Each User will perform 180000/100=1800 transactions/hour

Since, every transaction is taking on an average 0.5 seconds, let us see how much time is required to complete the each user transactions.
To complete 1800 trnx it will take 1800*0.5 = 15 minutes


So now, let us see how much think-time is required to complete the required number transactions per User in an hour.
1800 transactions will complete in 15 minutes
hence, 45 minutes of thinktime is required in between 1800 transactions (i.e. 45*60 = 2700 seconds of thinktime required in between 1800 transactions (per user))
2700 seconds = 1800 trnx
x = 1 trnx
x = 1.5 seconds think time need to include

Let us see how much time is required to complete each iteration.
Total time required to complete each Iteration = x + 0.5 seconds
= 1.5 + 0.5
= 2 seconds

Verification: Let us verify if our above calculation is correct.
Total time = 1800 * 2
= 3600 seconds
= 1 Hr

So, Each User will perform 1800 transactions where we will provide 2 seconds for each Iteration to complete.

Random Virtual User Pacing in LoadRunner:
I guess there's always a first time. I had never used LoadRunner's random virtual user (VU) pacing earlier, but am working on a project that will need to use this feature for the first time. And as I thought about it a little more, I may start using it more frequently now. Here's how it happened

This is one of the rare projects that provided me with excellent documentation - not only system documentation like the system specs, API Guides etc but also performance requirements like actual production volume reports and capacity models that estimated the projected volumes.

The capacity models estimated the maximum transaction load by hour as well as by minute (max TPM). What I needed to do was take maximum hourly load, divide it by 60 to get a per minute transactional load and use this as the average TPM. The idea was to vary the VU pacing so that over the whole duration of test, average load stays at this Average TPM but it also reaches the Max TPM randomly.

For example, if the maximum hourly transaction rate is 720 requests and maximum TPM is 20, the average TPM will be 720/60 = 12 and I will need to vary the pacing so that the load varies between 4TPM and 20TPM and averages to around 12TPM.
The Calculation:
To vary the transactional load, I knew I had to vary the VU Pacing randomly. Taking above example, I had to achieve 12TPM and I knew the transactions were taking around 1-2 seconds to complete. So I could have the pacing of around 120 seconds if I needed to generate a fixed load of 12TPM with a 5 second Ramp-up and 24 users.

ScriptTPMNumber of VUsPacing (sec)Ramp Up
Script 112241201 VU/5sec

So now to vary the TPM to x with the same 24 virtual users, I will need to have a pacing of 24*60/x. I got this from an old-fashioned logic which goes in my head this way:
24 users with a pacing of 60 seconds generate a TPM of 24
24 users with a pacing of 120 seconds generate a TPM of 24 * 60/120
24 users with a pacing of x seconds generate a TPM of 24 * 60/x

So using above formula, to vary the load from 20 to 4TPM I will need to vary the VU pacing from 72 to 360. So now we have:
ScriptTPMNumber of VUsPacing (sec)Ramp Up
Script 14 to 2024Random (72 to 360)1 VU/5sec

 

Of course, there's a caveat. The range of 72 to 360 seconds has an arithmetic mean of 216. 120 is actually the harmonic mean of the 2 numbers. So the actual variation in TPM will depend on the distribution of random numbers that LoadRunner generates within the given range. If it generates the numbers with a uniform distribution around the arithmetic mean of the range, then we have a problem.

I ran a quick test to find this out. I created an LR script and used the rand() function to generate 1000 numbers between the range with the assumption that LR uses a similar function to generate the random pacing values.

int i;
srand(time(NULL));
for (i=0;i<1000 br="" i="">lr_output_message("%d\n", rand() % 289 + 72);
}

And of course, the average came out close to the arithmetic mean of 72 and 360, which is 216.

So with the assumption that the function used by LoadRunner for generating random pacing values generates numbers that are uniformly distributed around the arithmetic mean of the range, we'll need to modify the range of pacing values so that the arithmetic mean of the range gives us the arithmetic mean of the TPM that we want...phew. What it means is that the above pacing values need to be modified from 72 to 360 (arithmetic mean = 216) to 72 to 168 (arithmetic mean = 120). However, this gives us the TPM range of 20 to 8.6 TPM with a harmonic mean of 12TPM.

But I'll live with it. I would rather have the average load stay around 12TPM. So here are the new values. Note the asterisk on TPM. I need to mention in the test plan that the actual TPM will vary from 8.6 to 20TPM with an average of 12TPM.

ScriptTPM*Number of VUsPacing (sec)Ramp Up
Script 14 to 2024Random (72 to 168)1 VU/5sec

HOW GARBAGE COLLECTION WORKS IN JAVA

The important things about the garbage collections are

1) objects are created on heap in Java irrespective of there scope e.g. local or member variable. while its worth noting that class variables or static members are created in method area of Java memory space and both heap and method area is shared between different thread.
2) Garbage collection is a mechanism provided by Java Virtual Machine to reclaim heap space from objects which are eligible for Garbage collection.
3) Garbage collection relieves java programmer from memory management which is essential part of C++ programming and gives more time to focus on business logic.
4) Garbage Collection in Java is carried by a daemon thread called Garbage Collector.
5) Before removing an object from memory Garbage collection thread invokes finalize () method of that object and gives an opportunity to perform any sort of cleanup required.
6) You as Java programmer can not force Garbage collection in Java; it will only trigger if JVM thinks it needs a garbage collection based on Java heap size.
7) There are methods like System.gc () and Runtime.gc () which is used to send request of Garbage collection to JVM but it’s not guaranteed that garbage collection will happen.
8) If there is no memory space for creating new object in Heap Java Virtual Machine throws OutOfMemoryError or java.lang.OutOfMemoryError heap space
9) J2SE 5(Java 2 Standard Edition) adds a new feature called Ergonomics goal of ergonomics is to provide good performance from the JVM with minimum of command line tuning.

When an Object becomes Eligible for Garbage Collection
An Object becomes eligible for Garbage collection or GC if its not reachable from any live threads or any static refrences in other words you can say that an object becomes eligible for garbage collection if its all references are null. Cyclic dependencies are not counted as reference so if Object A has reference of object B and object B has reference of Object A and they don't have any other live reference then both Objects A and B will be eligible for Garbage collection.
Generally an object becomes eligible for garbage collection in Java on following cases:
1) All references of that object explicitly set to null e.g. object = null
2) Object is created inside a block and reference goes out scope once control exit that block.
3) Parent object set to null, if an object holds reference of another object and when you set container object's reference null, child or contained object automatically becomes eligible for garbage collection.
4) If an object has only live references via WeakHashMap it will be eligible for garbage collection. To learn more about HashMap see here How HashMap works in Java.

Heap Generations for Garbage Collection in JavaJava objects are created in Heap and Heap is divided into three parts or generations for sake of garbage collection in Java, these are called as Young generation, Tenured or Old Generation and Perm Area of heap.
New Generation is further divided into three parts known as Eden space, Survivor 1 and Survivor 2 space. When an object first created in heap its gets created in new generation inside Eden space and after subsequent Minor Garbage collection if object survives its gets moved to survivor 1 and then Survivor 2 before Major Garbage collection moved that object to Old or tenured generation.

Permanent generation of Heap or Perm Area of Heap is somewhat special and it is used to store Meta data related to classes and method in JVM, it also hosts String pool provided by JVM as discussed in my string tutorial why String is immutable in Java. There are many opinions around whether garbage collection in Java happens in perm area of java heap or not, as per my knowledge this is something which is JVM dependent and happens at least in Sun's implementation of JVM. You can also try this by just creating millions of String and watching for Garbage collection or OutOfMemoryError.

Types of Garbage Collector in JavaJava Runtime (J2SE 5) provides various types of Garbage collection in Java which you can choose based upon your application's performance requirement. Java 5 adds three additional garbage collectors except serial garbage collector. Each is generational garbage collector which has been implemented to increase throughput of the application or to reduce garbage collection pause times.

1) Throughput Garbage Collector: This garbage collector in Java uses a parallel version of the young generation collector. It is used if the -XX:+UseParallelGC option is passed to the JVM via command line options . The tenured generation collector is same as the serial collector.

2) Concurrent low pause Collector: This Collector is used if the -Xingc or -XX:+UseConcMarkSweepGC is passed on the command line. This is also referred as Concurrent Mark Sweep Garbage collector. The concurrent collector is used to collect the tenured generation and does most of the collection concurrently with the execution of the application. The application is paused for short periods during the collection. A parallel version of the young generation copying collector is sued with the concurrent collector. Concurrent Mark Sweep Garbage collector is most widely used garbage collector in java and it uses algorithm to first mark object which needs to collected when garbage collection triggers.

3) The Incremental (Sometimes called train) low pause collector: This collector is used only if -XX:+UseTrainGC is passed on the command line. This garbage collector has not changed since the java 1.4.2 and is currently not under active development. It will not be supported in future releases so avoid using this and please see 1.4.2 GC Tuning document for information on this collector.
Important point to not is that -XX:+UseParallelGC should not be used with -XX:+UseConcMarkSweepGC. The argument passing in the J2SE platform starting with version 1.4.2 should only allow legal combination of command line options for garbage collector but earlier releases may not find or detect all illegal combination and the results for illegal combination are unpredictable. It’s not recommended to use this garbage collector in java.

JVM Parameters for garbage collection in JavaGarbage collection tuning is a long exercise and requires lot of profiling of application and patience to get it right. While working with High volume low latency Electronic trading system I have worked with some of the project where we need to increase the performance of Java application by profiling and finding what causing full GC and I found that Garbage collection tuning largely depends on application profile, what kind of object application has and what are there average lifetime etc. for example if an application has too many short lived object then making Eden space wide enough or larger will reduces number of minor collections. you can also control size of both young and Tenured generation using JVM parameters for example setting -XX:NewRatio=3 means that the ratio among the young and tenured generation is 1:3 , you got to be careful on sizing these generation. As making young generation larger will reduce size of tenured generation which will force Major collection to occur more frequently which pauses application thread during that duration results in degraded or reduced throughput. The parameters NewSize and MaxNewSize are used to specify the young generation size from below and above. Setting these equal to one another fixes the young generation. In my opinion before doing garbage collection tuning detailed understanding of garbage collection in java is must and I would recommend reading Garbage collection document provided by Sun Microsystems for detail knowledge of garbage collection in Java. Also to get a full list of JVM parameters for a particular Java Virtual machine please refer official documents on garbage collection in Java. I found this link quite helpful though http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html

Full GC and Concurrent Garbage Collection in JavaConcurrent garbage collector in java uses a single garbage collector thread that runs concurrently with the application threads with the goal of completing the collection of the tenured generation before it becomes full. In normal operation, the concurrent garbage collector is able to do most of its work with the application threads still running, so only brief pauses are seen by the application threads. As a fall back, if the concurrent garbage collector is unable to finish before the tenured generation fill up, the application is paused and the collection is completed with all the application threads stopped. Such Collections with the application stopped are referred as full garbage collections or full GC and are a sign that some adjustments need to be made to the concurrent collection parameters. Always try to avoid or minimize full garbage collection or Full GC because it affects performance of Java application. When you work in finance domain for electronic trading platform and with high volume low latency systems performance of java application becomes extremely critical an you definitely like to avoid full GC during trading period.

Summary on Garbage collection in Java1) Java Heap is divided into three generation for sake of garbage collection. These are young generation, tenured or old generation and Perm area.
2) New objects are created into young generation and subsequently moved to old generation.
3) String pool is created in Perm area of Heap, garbage collection can occur in perm space but depends upon JVM to JVM.
4) Minor garbage collection is used to move object from Eden space to Survivor 1 and Survivor 2 space and Major collection is used to move object from young to tenured generation.
5) Whenever Major garbage collection occurs application threads stops during that period which will reduce application’s performance and throughput.
6) There are few performance improvement has been applied in garbage collection in java 6 and we usually use JRE 1.6.20 for running our application.
7) JVM command line options –Xmx and -Xms is used to setup starting and max size for Java Heap. Ideal ratio of this parameter is either 1:1 or 1:1.5 based upon my experience for example you can have either both –Xmx and –Xms as 1GB or –Xms 1.2 GB and 1.8 GB.
8) There is no manual way of doing garbage collection in Java.

Latency Vs Bandwidth

One of the most commonly misunderstood concepts in networking is speed and capacity. Most people believe that capacity and speed are the same thing. For example, it's common to hear "How fast is your connection?" Invariably, the answer will be "640K", "1.5M" or something similar. These answers are actually referring to the bandwidth or capacity of the service, not speed.

Speed and bandwidth are interdependent. The combination of latency and bandwidth gives users the perception of how quickly a webpage loads or a file is transferred. It doesn't help that broadband providers keep saying "get high speed access" when they probably should be saying "get high capacity access". Notice the term "Broadband" - it refers to how wide the pipe is, not how fast.

Latency:

Latency is delay.

For our purposes, it is the amount of time it takes a packet to travel from source to destination. Together, latency and bandwidth define the speed and capacity of a network.

Latency is normally expressed in milliseconds. One of the most common methods to measure latency is the utility ping. A small packet of data, typically 32 bytes, is sent to a host and the RTT (round-trip time, time it takes for the packet to leave the source host, travel to the destination host and return back to the source host) is measured.

The following are typical latencies as reported by others of popular circuits type to the first hop. Please remember however that latency on the Internet is also affected by routing that an ISP may perform (ie, if your data packet has to travel further, latencies increase).

Ethernet                  .3ms
Analog Modem              100-200ms
ISDN                      15-30ms
DSL/Cable                 10-20ms
Stationary Satellite      >500ms, mostly due to high orbital elevation
DS1/T1                    2-5ms


Bandwidth:

Bandwidth is normally expressed in bits per second. It's the amount of data that can be transferred during a second.

Solving bandwidth is easier than solving latency. To solve bandwidth, more pipes are added. For example, in early analog modems it was possible to increase bandwidth by bonding two or more modems. In fact, ISDN achieves 128K of bandwidth by bonding two 64K channels using a datalink protocol called multilink-ppp.

Bandwidth and latency are connected. If the bandwidth is saturated then congestion occurs and latency is increased. However, if the bandwidth of a circuit is not at peak, the latency will not decrease. Bandwidth can always be increased but latency cannot be decreased. Latency is the function of the electrical characteristics of the circuit.

90TH PERCENTILE

90th percentile Response Time is defined by many definitions but it can be easily understood by:
"The 90th percentile tells you the value for which 90% of the data points are smaller and 10% are bigger."
90% RT is the one factor we should always look in once the Analysis report gets generated
To calculate the 90% RT
1. Sort the transaction RT by their values
2. Remove the top 10% instances
3. The higher value left is the 9oth percentile RT.
For e.g. Consider we have a script with transaction name "T01_Performance_Testing" and there are 10 instances of this transaction, i.e. we ran this transaction for 10 times.
Values of transaction's 10 instances are
 
1. Sort them by their values

2. Remove top 10% values, i.e. here 9Sec

3. 8 Sec is the 90th percentile RT.

x