Spike a single request after certain interval in JMeter - jmeter

I am running a 5000 users soak test with 300 RPS using JMeter. Test duration is 1 hour. How do I spike a single request to 300 after certain interval (20 minutes)? I also want to hold that that spike for 2-3 minutes and then revert to normal load.
I tried Synchronizing Timer but it generates spike for every iteration. My requirement is to generate a spike after 20 minutes only.

My expectation is that you should consider switching to Throughput Shaping Timer, it allows you to flexibly and precisely control the throughput in terms of "requests per second" so you can define how many RPS you want to have for this or that test phase.
An example implementation of your test scenario would be something like:
replace 1 with the desired RPS value for the "normal" load.
A good idea would be using the Throughput Shaping Timer in combination with the Concurrency Thread Group - this way JMeter will be able to kick off extra threads in order to reach/maintain the desired load.
You can install both plugins using JMeter Plugins Manager

Related

Jmeter- how to achieve throughput same as the user count in jmeter

How can I acheive below transaction per hour. I tried to control login by using once only controller ,But transaction per hour is still more than 70. How to handle this?
Overall User count is 70
Transaction per hour for login -- 70
Transaction per hour for homepage -- 100
If you need JMeter to execute exact amount of transactions, not more, not less - go for Throughput Controller
Similarly you can configure 100 homepage transactions.
In order to evenly distribute 70/100 transactions for the duration of one hour time frame you can play with ramp-up period and Constant Throughput Timer
Be aware that you won't be able to achieve different throughputs for different samplers under the same Thread Group as JMeter will always wait for the previous sampler to finish prior to executing the next one hence it will act at the speed of the slowest sampler.
More information: Running JMeter Samplers with Defined Percentage Probability
A couple of other options:
Use the Arrivals Thread Group. This TG will allow you to
configure the desire average throughput (ATP); the TG will
instantiate the required threads needed to achieve the ATP goal (no
guessing)
Use the Concurrency Thread Group together with Throughput
Shaping Timer. These option will also autoscale the number of Vusers
see more information here
Be aware that the downside of these options is that vusers is are instantiate using a fixed pacing. In general, this is not how rusers interface with an application in the real world.

Controlling number of Samples in bzm - Concurrency Thread Group

I am trying to find out throughput of an endpoint using Apache Jmeter as testing tool.
I need to hit the endpoint at n threads(users) per second, and every thread should fire exactly one requests(sample).
For the above i configured bzm - Concurrency Thread Group.
Configuration One:
Target Concurrency: 100
Ramp Up Time(sec): 1
Ramp-up Steps Count: 1
Hold Target Rate Time(sec): 10
Configuration Two:
Target Concurrency: 1000
Ramp Up Time(sec): 5
Ramp-up Steps Count: 5
Hold Target Rate Time(sec): 60
What i expect is
a. Configuration One: only 1000 request must be fired in 10 sec.
b. Configuration Two: 60000 requests must be fired in 60 sec i.e 1000/sec.
As per your test case and test duration settings, I think, you are making confusion with the Threads and Requests.
Threads are virtual users. Threads and Requests aren't the same.
Ramp up is the time in which all the users arrive on your tested application server.
Requests are simulated by samplers but threads are the simulation of users.
Please note- The total number of requests are related to throughput, Whereas the number of active threads performing the same activity is related to concurrency.
You can achieve your requirements by using Constant Throughput Timer at your test plan level.
Constant Throughput timer allows you to maintain the throughput of your server (requests/sec). Constant Throughput Timer is only capable of pausing JMeter threads in order to slow them down to reach the target throughput. Also, it works only on a minute level so you need to properly calculate the ramp-up period and let your test run long enough.
Here are the workarounds:
Calculate the number of threads you need to achieve your target throughputs. Formula is:
RPS * max response time in second
Use the Ramp-up periods for the threads to active accordingly.
Make the loop count value to Forever
Set the test duration accordingly.
As Constant Throughput Timer works on a minute level, to achieve X RPS you have to configure your "Target Throughput" value to X*60/min and "Calculate Throughput based on" value as "All active threads".
For example, if you need 1000 RPS, then "Target Throughput" value should be 60000/min in Constant Throughput Timer.
Check out my answers on these threads to understand your scenario more briefly.
How should I calculate Ramp-up time in Jmeter
Struggling to maintain Requests per Second (RPS)?
Hope this helps!

How to configure Jmeter to generate 50 HTTP requests every 5 seconds with variable concurrency

I have tried plethora of configurations with varying values for Number of Threads and Ramp-Up period and also tried to use uniform random timer stuff but in vain. Any help appreciated !
You can use Ultimate Thread Group for varying your concurrency. You can download it via JMeter Plugins Manager.
Here is an example for 60 seconds test duration with different concurrency:
To generate 50 requests every 5 second means 10RPS. To generate this scenario, you can use Constant Throughput Timer.
Constant Throughput Timer allows you to maintain the throughput of your server (requests/sec). As Constant Throughput Timer works on minute level, At the end of your test, you will get your desired Throughput which you mentioned in Constant Throughput Timer i.e. if you have mentioned 600/min in Constant Throughput Timer with "Calculate Throughput based on" value as "All active threads", you will get 10RPS.
You can also monitor these by using listeners like Active Threads Over Time and Hits per Second.

Jmeter- Thread Group- Thread Properties

Our requirement is to execute
1 user/thread, 10 requests/sec, Total requests = 10,000
With current Thread Properties not able to achieve.
Only one user/thread send 10 request/sec and total should be 10000 requests. Any other way to achieve this in Jmeter ?
Is following approach is correct ? We used Loop controller. So each request will repeat 10 times
You will be able to achieve 10 requests/second with 1 virtual user only if your response time will be 100 milliseconds. If response time will be more than 100 milliseconds - you will not be able to reach the desired load.
If your application fails to respond in 100 milliseconds time frame - most probably you've found a performance bottleneck and you can report this to your application developers.
If you have some time to investigate the issue you can try to provide more information, i.e. what is the average response time, what are minimum, maximum, quantiles, the actual number of requests per second, etc, all this information can be retrieved using Aggregate Report listener.
Normally when people are looking for the answer if the application under test can support X requests per second they use > 1 virtual user as load test should represent real life usage of the system under test and 1 thread (virtual user) isn't normally associated with performance testing and derivatives.
So probably you should reconsider your approach to testing and try increasing the number of threads (virtual users). The throughput can be controlled using Precise Throughput Timer or Constant Throughput Timer. However be aware that the above timers can only pause JMeter to slow it down to the desired throughput. Another approach is using Concurrency Thread Group and Throughput Shaping Timer combination, they can be connected using Feedback Function so JMeter will kick off extra threads in order to reach/maintain the desired number of requests per second.
You can install Concurrency Thread Group and Throughput Shaping Timer using JMeter Plugins Manager

Relation between throughput and threads in Jmeter

I am novice to Jmeter, and I have certain queries which I am not able to get from the Jmeter home site.
What does throughput value exactly mean - does it mean it is no of requests per second for each thread or it is no of requests cumulatively across threads ?
I want to run a test for 5 minutes evenly spread across 125k requests, how do I specify throughput and delay values assuming no of threads is 60?
The values starttime , endtime, duration, delay, rampup period, etc given in Jmeter file are of seconds/milliseconds ? How can I configure them ?
How can I find the transactions per second value during or after the test ?
As per JMeter Glossary
Throughput is calculated as requests/unit of time. The time is calculated from the start of the first sample to the end of the last sample. This includes any intervals between samples, as it is supposed to represent the load on the server.
The formula is: Throughput = (number of requests) / (total time).
You can set test execution time either using "Scheduler" section of Thread Group where you can set Duration (seconds) for the test. By default JMeter executes samplers as fast as it can however you can use Timers to simulate user think time or add pauses between requests for any other reason. Desired execution rate in "requests per minute" can be set via Constant Throughput Timer
The values are in seconds. Configure them according to your load scenario. As per thread group documentation:
Ramp-up needs to be long enough to avoid too large a work-load at the start of a test, and short enough that the last threads start running before the first ones finish (unless one wants that to happen).
Start with Ramp-up = number of threads and adjust up or down as needed.
The easiest option is using Transactions per Second listener available through JMeter Plugins

Resources