Skip to main content

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))
        {
          Action2();
        }

Note: It's advisable to create a new action in which you can write the above code.

Comments

Popular posts from this blog

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...

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...

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...