How to handle TPS in JMeter / Load Runner - jmeter

I have an HTTP request which contains messages (json body). I need to achieve 1000 messages/sec throughout the load test. But I also need to randomize the number of messages (with different combinations like 100 messages in one HTTP Request, 200 and 300 etc.). Could anyone please let me know how can we achieve this in JMeter or Load Runner? My concern is that at any point, the maximum number of messages sent should not exceed 1000/sec.

To control message rate, you can use Throughput Shaping Timer
To send different type of messages you can use a CSV file and use component CSV DataSet to load it and read each line as a message into variable (let’s say you call it varName) which you can then use as ${varName} ad body of Http Request

1000 messages/sec throughout
LoadRunner - cannot be done (you can try to achieve this using Pacing but anyway it will mostly depend on your application response time)
JMeter - you can use one of the following:
Constant Throughput Timer
Throughput Shaping Timer
Precise Throughput Timer
Random number of messages in the request body payload: in both tools you will have to write some code for this, in LoadRunner you basically have to write the code for everything, in JMeter you can add JSR223 PreProcessor and use Groovy language for message payload creation

Not sure what a message means exactly in your requirement. But generally in LoadRunner you can create goal-oriented scenario and set the goal definition like average hits per second or average throughput (bytes/sec).

Related

Unable to achieve TPS while using throughput controller along with Unique Each occurance parameterization customization

I've to execute a test where one transaction can have multiple-lines (Eg: orders placed by different users in the real world where every user can have different cart size). In order to achieve this I have a products list and I need unique product at every occurrence. I have used a code similar to this "https://www.perfmatrix.com/jmeter-parameter-setting-unique-each-occurrence/" and I was able to achieve unique each occurrence. But the problem is when I am using a throughput controller and constant throughput timer I am not able to achieve desired TPS whereas hardcoded payload with various lines (with throughput controller and constant throughput timer) leads to desired TPS. Do we have any other options to achieve this?
Beanshell Sampler might be the root cause of the problem, according to JMeter documentation you should be using JSR223 Test Elements and Groovy language for scripting since JMeter 3.1 because using Beanshell is a some form of a performance anti-pattern, check out Apache Groovy: What Is Groovy Used For? article for more details.
Another possible reason could be test data itself, for example request A is "light" and returns data in less than one second due to its request parameters and request "B" is "heavy" and returns data in more than 5 seconds.
Throughput of 100 requests A and 100 requests B will be different so you might need to add more threads.

What timer to use to control the API requests?

I am trying to load test an API and I am trying to make sure I fire only 2 requests in a second due to the throttling limit set at the API Gateway level so if the third request is sent within a second (this happens if the response time of the earlier request is < 1 sec) then I get HTTP-429 error saying 'too many requests'. Please could someone suggest if I can use any timer to achieve this?
Thanks,
N
Constant Throughput Timer is the easiest of built-in test elements, 2 requests per second is 120 requests per minute. However it is precise enough only on "minute" level so you might need to play with ramp-up period
Precise Throughput Timer is more "precise" but a little bit harder to use as you need to provide controlled throughput and test duration
If you don't mind using JMeter Plugins there is Throughput Shaping Timer which provides the maximum flexibility and visual way of defining the load
For this particular case, I suggest the Arrivals Tread Group. This TG will let you exactly configure the desired TPS (Arrival Rate), plus the plugin will instantiate the necessary threads to generate the load. No need to guess how many threads/vusers you'll need.

JMeter AMQP Publisher (Sampler)

I am using an AMQP Publisher Sampler within my JMeter Test Plan, is there any way to loop and Publish the Message Content using a defined time period (i.e. once per second)?
As part of the Message Content I am sending a TIMESTAMP that will update through each loop iteration.
Check out Constant Thoughput Timer and Throughput Shaping Timer, this way you will be able to limit sampler(s) execution rate to the desired one.
The latter can be installed using JMeter Plugins Manager

Firing multiple soap requests with different data through JMeter

I want to fire multiple soap requests with different data through jmeter and I want all the soap requests to hit the application concurrently. Also I would like to know if I can do the same thing with soap ui? If possible do describe the steps in detail. Thanks in advance.
For JMeter:
Add HTTP Request sampler to your test plan
Add Switch to "Body Data" tab and put your XML payload skeleton there
Substitute the parts of the body you want to parameterise with JMeter Variables or Functions, the most commonly used for parameterisation test elements are:
CSV Data Set Config
__StringFromFile()
__FileToString()
__CSVRead()
For "concurrency" you also have different options:
If you want X threads to execute requests as fast as they can - just specify them in Thread Group
If you want X requests per second - go for Constant Throughput Timer
If you want all requests at exactly the same time - Synchronizing Timer
For SoapUI check out Simulating Different Types of Load article

Jmeter Request Execution

I am trying to understand jmeter's core behavior.
Say I am executing a HTTP request (single user and single sampler but different variable values) in infinite loop.
In the above case does jmeter send a request and waits for the response before sending the next request OR it sends the requests without waiting for response?
Jmeter uses a thread-based model where each thread will wait for a response before sending another request. In other words it will only drive the load as fast as application can take it.
In JMeter you specify a number of threads in a ThreadGroup which equate to virtual users, and the threads attempt to execute the script as many times as possible.
If you want to maintain a constant rate, you can use multiple threads and use a Constant Throughput Timer to set the request rate: if there are enough threads, it should be possible to maintain the rate even though some threads are waiting for a response. Here belongs also custom Throughput Shaping Timer which is more flexible.
Another possibility seems to be to use e.g. either Ultimate Thread Group or Stepping Thread Group from jmeter plugins.
In this context you can also look onto the Response Timeout field available for any jmeter's sampler - number of milliseconds to wait for a response.

Resources