web_stream functions in loadrunner (web_stream_open & web_stream_close) and Error -26309: Another streaming with the same ID


Video streaming has become a common factor nowadays and most of the web pages are having videos streaming in them. So we will have to test the performance of the videos also, like the rendering time, buffer time, play time and so on.

Below are the loadrunner functions which get generated when we record a web page with video streaming in it. All the functions are straight forward and easy to understand.


If we notice, we have a ID assigned to the video in the web_stream_open function and the same ID is passed on to the other web_stream functions below. This ID is generated by loadrunner and will be unique to each video.

Script works fine in Vugen and when the same script is run with multiple concurrent users in controller, we get the below error message.

Error -26309: Another streaming with the same ID "3" has already been registered. Please set a new ID not registered

Error message means that one of the vuser is using the video with the ID = 3 and another vuser is trying to access the same video with ID = 3, and it is unable to stream the video. It is also requesting us to set a new unregistered ID to access the same video content.

Now, what we have to do is, we need to modify the ID in such a way that vusers do not clash when trying to stream the same video. Initially I tried using the inbuilt parameters like unique, random and vuser to replace ID, but still I got the same error. As a next step I wrote a C code using srand() & rand() to generate random numbers as ID for each vuser and pass it on to the argument ID. Below is the code snippet.







web_concurrent_start & web_concurrent_end

Need for Concurrent group functions:

A web page contains elements like html, jpeg, png, css service call and so on. When we try to load a web page of this kind, all these different elements make a parallel call to the servers to get loaded up. So at the end it is a single page that loads in front of our eyes.
These parallel concurrent calls can be simulated in Loadrunner using web_concurrent_start & web_concurrent_end functions. All the requests of the elements in a web page are recorded in-between these concurrent group functions. Thus making the simulation more realistic.
We can select this option under Recording Options -- Recording  -- HTML Based Script -- Non HTML - generated elements ( Record in separate steps and use concurrent groups )
What is concurrent execution?
Different multiple requests executed at the same point of time.
Characteristics:
  • The web_concurrent_start & web_concurrent_end functions mark the beginning and end of a concurrent group.
  • Functions (requests) included within the concurrent group are not executed immediately
  • web_concurrent_start registers the functions (requests) for a concurrent execution.
  • web_concurrent_end executes all the registered functions concurrently.
  • These functions are supported for all Web scripts.




Garbage Collection (Minor & Major) & Garbage Collection types in detail

A fantastic article which explains in detail about how Garbage Collection works in different heap memory areas in Java & also about the various types of Garbage Collection Algorithms and best among them to chose for the application.

https://www.cubrid.org/blog/understanding-java-garbage-collection

How to distribute the users in a single script across multiple load generators in controller - Loadrunner

When a script or group has more vusers then trying to simluate them in a single LG will cause high CPU utilization. To overcome this we need to distribute the vusers of the sript across multiple LG's.

Steps to do that.

1. Go to the Design tab in the Controller
2. Select the group or script whose vusers need to be distributed across multiple load generators.
3. Click the Virtual Users icon (second from the left, looks like two tiny persons in the icon, just above the list of groups) and The Vusers list for the group pops up.


4. Here I have 3 users which I need to spread across 3 LG's (10.100.11.235/10.100.11.236/localhost).


5. Select the Vusers and click the Details button then Vuser Information Dialog box pops up.
6. Select the LG from the Load Generator Name drop down and click OK. Repeat this step for all the Vusers in the list like shown below. Then close the dialog box.


7. Now we can see that the selected LG's are displayed against the Group Name.



How to do a Failover or Session Replication Testing?


Failover Testing – Nowadays we have applications which try to provide services to the customers 
24 X 7 unless and until they have planned maintenance window’s. Example for this is any banking application. Moreover, clustered servers are deployed these days to ensure the performance, availability and scalability of the applications are improved.
So in Failover testing we will be testing the availability of the application when one of the servers goes down in the cluster. Or in other words we can check how the other online servers are handling the load when few of the servers in the cluster goes offline.  

This failover testing is also known as session replication testing. Session replication is a mechanism used to replicate the data stored in a session across different instances. However, the replicated instance must be part of the same cluster. When session replication is enabled in a cluster environment, the entire session data is copied on a replicated instance. So when one instance goes offline the user will be able to use the same session without any interruption because of its replication. This is to ensure that business is carried out smoothly.
Failover or session replication testing can be done on both Application & Database servers. Usually failover testing is done with the peak load.

Approach:

Failover Table
In the above table we can see that there are 2 server instances. We have to divide the duration of the test into time slots to perform this.
Phase 1 is the Ramp up period, where all the users are brought into the system and they take some time to reach the steady state. In this phase the load will be balanced between 2 server instances.
Phase 2 is where the first failover begins. In our case we make the Server 1 to go offline. Now the CPU utilization of Server 2 will increase since it takes the additional load from Server 1.
Phase 3 we will bring back the Server 1 to online. So again the load should be shared among the server instances. Meaning Server 1 CPU utilization will start to grow and Server 1 CPU utilization will start to reduce and they will reach a balancing point. We need to measure the recovery time of Server 1
Phase 4 is where the second failover begins. In our case we make the Server 2 to go offline. Now the CPU utilization of Server 1 will increase since it takes the additional load from Server 2.
Phase 5 is same as that of Phase 3.
Failover CPU Utilization - Sample
Test Report:

Below are the metrics to be captured in a Failover test report.
  • Server recovery time in Phase 3 & 5.
  • CPU & Memory utilization of both the servers in each Phase.
  • Response time of all the transactions in each phase.