Skip to main content

Posts

Running Vuser as a Process vs. Running Vuser as a Thread

One common dilemma for performance testers is deciding whether to run Vusers as processes or threads. To make an informed choice, it’s important to first understand the distinction between a process and a thread. 1. Process : A process is an instance of a computer program being executed, with its own dedicated virtual address space. Multiple processes can run simultaneously, but each process operates independently and does not share its memory address space with others. Example : If you open Notepad, you’ll see a process named notepad.exe in the task manager under the Processes tab. Opening another instance of Notepad will create a second notepad.exe process. Each process has its own memory space, and communication between processes happens through mechanisms like inter-process communication (IPC). 2. Thread : A thread exists within a process and shares the process’s memory address space with other threads. Multiple threads within the same process can access shared memory, and when o...

Why Memory Leaks Often Go Unnoticed Until Load Testing

Memory leaks can arise in various ways depending on how they are introduced, but they all exhibit a similar behavior, which ultimately makes them a performance issue. To demonstrate, consider a simplified example involving a process. Imagine you're testing a function on a web server, where the process executes a computation and returns a result. During this, it requests a chunk of memory. However, due to a bug, the process mistakenly requests the same chunk twice. When the result is returned, it only releases one chunk, leaving the other unreleased. Each time this function is called, the same issue occurs, and over time, the process consumes more of the host machine’s available memory, leading to a "memory leak." As this continues, the host system is impacted because the memory that should have been freed is never returned, causing the process to consume excessive resources until it either crashes or is forcefully terminated. In my experience, these types of memory leaks ...

How to do Performance Testing for IoT?

Performance Testing for IoT (Internet of Things) involves evaluating the efficiency, responsiveness, scalability, and reliability of IoT systems and devices under various conditions. IoT systems typically consist of interconnected devices, sensors, networks, and applications that collect, process, and exchange data. Performance testing ensures that these systems function optimally under different loads and scenarios, providing a seamless experience to users and maintaining system integrity. Key Aspects of IoT Performance Testing Latency : Measuring the time it takes for data to travel from an IoT device to the cloud or server and back. Throughput : Assessing the amount of data that can be processed by the system in a given period. Scalability : Ensuring the system can handle an increasing number of devices and data without degradation in performance. Reliability : Testing the system's ability to perform consistently under different conditions, including network instability or devi...

How to write a Performance Test Plan

 A test plan gives complete information on the testing scope, timeline, and strategy. Here's a step-by-step guide to help you create an effective performance test plan: 1. Define the Purpose and Scope: Start by clearly stating the objectives of your performance testing. What are you trying to achieve, and what aspects of your application will you be testing (e.g., load, stress, scalability, or endurance)? 2. Identify Stakeholders: List all the individuals and teams involved in the performance testing process, including developers, QA engineers, system administrators, and project managers. Define their roles and responsibilities. 3. Set Performance Goals: Define specific performance goals and acceptance criteria. These could include response time thresholds, throughput requirements, error rates, and resource utilization targets. Make sure these goals align with business expectations. 4. Determine Performance Metrics: Select the performance metrics and key performance indicators (KPI...

How CPU impacts the application performance?

The CPU (Central Processing Unit) plays a vital role in determining the performance of an application.  Here's how the CPU affects application performance: Processing Power: The CPU is responsible for executing instructions and performing calculations required by the application. A more powerful CPU with a higher clock speed and more cores can handle complex computations and process instructions faster, leading to improved application performance. Response Time: The CPU speed directly influences the response time of an application. A faster CPU can execute instructions more quickly, resulting in reduced response times and faster application performance. Multitasking and Parallel Processing: Modern CPUs with multiple cores allow for the concurrent execution of tasks, enabling better multitasking and parallel processing. This can significantly enhance the performance of applications that can effectively utilize multiple threads or processes. Bottlenecks: CPU bottlenecks can occur whe...

Why do we need performance testing for any application

 Performance testing is essential for any application for the following reasons: Evaluate System Responsiveness: Performance testing helps assess the responsiveness of an application under different loads. It measures the response time and throughput to ensure that the application performs within acceptable limits, providing a smooth and satisfactory user experience. Identify Bottlenecks and Performance Issues: Performance testing helps identify performance bottlenecks, such as slow database queries, inefficient code, resource constraints, or network latency. By pinpointing these issues, you can optimize the application to enhance its performance and scalability. Ensure Scalability and Capacity Planning: Performance testing allows you to determine the scalability of an application. It helps determine how well the application can handle increased loads and whether additional resources or infrastructure upgrades are required to support growing user demands. Capacity planning ensures ...

How to troubleshoot high Memory utilization during performance testing

 When troubleshooting high memory utilization during performance testing, it's important to identify the underlying causes and take appropriate steps to address the issue.  Here are some steps to troubleshoot high memory utilization: Monitor Memory Usage: Use performance monitoring tools to track memory usage over time. Monitor both physical and virtual memory (RAM) to identify if memory consumption is exceeding available resources. Identify Memory-Intensive Processes: Identify the specific processes or components that are consuming a significant amount of memory. Performance monitoring tools can help you identify the memory-hungry processes. Look for any particular application, service, or module that stands out in terms of memory usage. Analyze Code and Memory Allocation: Review your application's code and algorithms to identify any memory leaks, inefficient memory allocation, or excessive object creation. Look for areas where large amounts of memory are being consumed unnec...

How to troubleshoot high CPU utilization during performance testing

When troubleshooting high CPU utilization during performance testing, it is important to identify the root cause of the issue. Here are some steps you can take to troubleshoot and address high CPU utilization: Monitor System Resources: Use performance monitoring tools to track CPU usage over time. Monitor other system resources such as memory, disk I/O, and network usage to understand if any of these factors are contributing to high CPU utilization. Identify CPU-Intensive Processes: Identify the specific processes or components that are consuming a significant amount of CPU resources. Performance monitoring tools can help you pinpoint the culprits. Look for any particular application, service, or module that stands out in terms of CPU usage. Analyze Code and Algorithms: If your application has custom code or algorithms, review them for any inefficiencies or performance bottlenecks. Look for areas where CPU-intensive operations are performed frequently or where large amounts of data are...

What is Performance Testing - Advanced Level

For advanced testers, performance testing goes beyond the basic validation of response times and throughput. It involves a more comprehensive and detailed approach to evaluate system performance under various conditions.  Here are some aspects of performance testing that advanced testers typically focus on: Performance Test Planning: Advanced testers excel in creating well-defined performance test plans. They analyze the application architecture, identify critical scenarios, determine performance goals, and select appropriate performance testing techniques and tools. Performance Test Design: Advanced testers design complex and realistic performance test scenarios that accurately mimic real-world usage patterns. They incorporate various factors like user profiles, data volumes, transaction mix, and think creatively to cover different testing objectives. Performance Test Execution: Advanced testers execute performance tests with precision and accuracy. They monitor system resource...

Key performance metrics to monitor

  In performance testing, various key metrics are measured to evaluate the behavior and effectiveness of a system under different loads. The selection of specific metrics may vary depending on the type of application and its intended use. Here are some commonly used performance metrics: Response Time: The time taken for the system to respond to a user request. It includes the server processing time, network latency, and client-side rendering time. Throughput: The number of transactions or requests processed by the system within a given time frame. It indicates the system's capacity to handle concurrent user requests. Concurrent Users: The number of simultaneous users or connections the system can support without significant degradation in performance. Error Rate: The percentage of failed or erroneous transactions or requests compared to the total number of transactions. It helps identify system stability and reliability. CPU Usage: The percentage of CPU resources utilized by th...

String Comparison in Loadrunner script

How to compare a string in Loadrunner script? -There are various methods to compare a string, in below example we have used "strcmp" to compare two values. We have captured a string in "pComparisonString" parameter and comparing it with ABC. Lets say if you have captured some string using correlation and want to compare if the captured string meets the condition then only pass the transactions else fail the transaction: if (strcmp(lr_eval_string("{pComparisonString}"),"ABC") == 0) { lr_output_message("The parameter value is %s", lr_eval_string("{pComparisonString}")); lr_end_transaction("Transaction_Failed",LR_FAIL); } else { lr_error_message("No parameter value captured."); lr_end_transaction("Transaction_Passed",LR_PASS); } -------------------------------------------------------- strcmp- String comparison function. pComparisonString- String which we have captured for compar...

What is Performance Testing and why it is important?

We spend most of our time by browsing Facebook, watching videos, uploading photos and many other online activities. Have you ever noticed if you are watching a video and all of sudden the website goes down? If you are trying to book an online ticket and on the payment page, the website stops responding? If you are adding the last available item on sale in the shopping cart and the website gets hung? Isn't it stressful? For every growing business, it's very crucial to keep a tap on the performance of their application. If a website takes more than 2 seconds to respond then users tend to move to some other website which can cause a huge business loss.  Let's say you are on a retail website and browsing for some item that takes around 2-3 seconds to respond to each click or loading the page. In most cases, the user will go for some other website. Performance Testing gives an idea about how the system is going to behave on load and can help the business owners to ...

What is Pacing and how it's different from the Think Time

Pacing is the time that will hold/pause the script before it goes to the next iteration. i.e Once the Action iteration is completed the script will wait for the specific time(pacing time) before it starts the next one. It works between two actions. eg, if we record a script there will be three default actions generated by the Load Runner: vuser_init, Action, and vuser_end, the pacing will work after the Action block and hold the script before it goes to repeat it. The default blocks generated by LoadRunner is shown below: Actions marked in Red Think Time: It replicates the real-time user behavior by adding a delay between two actions/transactions.  In one of the interviews, I was asked if we give think time at the end of the script it will also work as Pacing then why HP has given two different parameters for the same purpose. Each of them has a different purpose: Think Time will keep the thread active and LoadRunner will expect for another transaction, however, in pacing t...

Auto Correlation issue in VUGen 12

The auto correlation rule in VUGen 12 sometime fails to capture the values due to maximum length limit. You can increase the maximum length by: Increase the length of ‘MaxParamLen=4096’ to 99999 in ‘correlationsettings.xml’ file in \\vuGen\config folder. Save the changes and restart the VUGen, the auto correlation rule will capture the data.

How to write or print data in notepad using append mode?

We can use the below function to print a value in notepad using append mode, it will keep on adding the data in notepad. This function can be used for data filtration from a parameter file. long fd; char buff[100]; web_reg_save_param("cRequest_id","LB=---","RB=---","ORD=1",Last); //Before closing the Action strcpy( buff,lr_eval_string("{cRequest_id}") ); fd=fopen( "C:\\NotepadName.txt","a" ); fprintf( fd,"%s\n",buff ); fclose( fd ); } In this example we are capturing the cRequest_id from correlation and printing in notepad.

SAP GUI Text check (Error Handling)

SAP GUI Text check (Error Handling) sapgui_status_bar_get_text("paramStatusBarText",                    BEGIN_OPTIONAL,                              "Recorded status bar text: Material document 4900089763 posted",                              "AdditionalInfo=sapgui1067",                    END_OPTIONAL);           lr_end_transaction("S31_SAP_Fleet_MIGO_1090_ClkPost", LR_AUTO); i = sapgui_status_bar_get_param("1", "param1", LAST); lr_output_message("Material Document Number is: %s",lr_eval_string("{param1}")); if(i==1)            { lr_output_message("Material Document creation failed and input data used is : %s", lr_eval_string("{pUserName}"));       ...

Error handling using Text Check

Error handling using if else condition. web_reg_find("Search=All",                      "Text/IC=Home Page",                      "SaveCount=home_count",                       LAST); //then after login block paste this code: if (atoi(lr_eval_string("{home_count}")) > 0)                 {                       lr_output_message("Log on Successful");                 }     else               {                     lr_output_message("Log on failed for the Login ID: %s", lr_eval_string("{pUserName}"));                     lr_exit( LR_E...

Save a parameter in notepad file

This code will create a notepad file and save the parameter into it. long fd; web_reg_save_param("saveID","LB=---","RB=---","ORD=1",Last); //Capture the value in "saveID" fd=fopen( "C:\\NotepadName.txt","a" ); //Path of notepad fprintf( fd,"%s\n",lr_eval_string("{saveID"})); //It will print the data and go to next line fclose( fd ); // It will close notepad.

Pacing Time in LoadRunner

What is Pacing? Where and why to use it? -Pacing is the time which will hold/pause the script before it goes to next iteration. i.e Once the   Action   iteration is completed the script will wait for the specific time(pacing time) before it starts the next one. It works between two actions. eg, if we record a script there will be three default actions generated by the Load Runner:   vuser_init, Action   and   vuser_end,   the pacing will work after the   Action   block and hold the script before it goes to repeat it. The default blocks generated by LoadRunner is shown below: Actions marked in Red Now we know what is pacing and we use it between two iteration. The next question comes to mind is why we use pacing: Pacing is used to: To control the number of TPS generated by an user. To control number of hits on a application under test.     Types of Pacing: There are three options to control the pac...

Load distribution on TPS (Transactions per seconds)

We can distribute the total number of users in a script randomly, e.g if there are more than one Action in a script and we want to execute it randomly, we can use the below syntax: =================================================================== int generateRandomTPS; //declaring the variable name generateRandomTPS = rand() % 99;  //Random number between 0 and 100     //This is check if the randomly generated number is between 0 to 49 then run Action1.     if ((generateRandomTPS >= 0) && (generateRandomTPS <=49))          {             Action1();           }   //This is check if the randomly generated number is between 50 to 100 then run Action2.  else if ((generateRandomTPS >= 50) && (generateRandomTPS <=100))      ...