I am using JMeter to load test my application. This is how my thread group configuration looks like:
I am expecting to hit the application with 200 threads (requests) and keep up that load for 30 minutes.
I am using 5 throughput controllers which use percentage executions and each HTTP request (under each controller) uses a specific percentage (totals to a 100).
I use the non-GUI mode to start the test and output the results to a csv. When I plot this though (using Kibana), I see a graph which looks like this
I see a peak and drop every 5 minutes. I am expecting to see uniform load across the 30 minutes I am running my test. Any idea why this is happening ? Is there something wrong with my configuration ?
Looking into "Loop Count" of 1 in your Thread Group I don't think your tests lasts 30 minutes, my expectation is that it takes seconds (or whatever time is needed to execute all your Samplers with 200 threads)
So tick Forever box or set "Loop Count" to -1 and re-run your test.
More information: JMeter Test Results: Why the Actual Users Number is Lower than Expected
Related
I am currently using Jmeter for API Performance Testing, but recently I started to look into Gatling as a potential replacement of Jmeter. Below is the PoC I'm doing for Gatling but I notice the performance result is very different.
Setup:
where we hit a https endpoint with a concurrent user of 10 for 60 seconds.
Results
Jmeter: 10 threads (no ramp up), 60 seconds
Result: 150 TPS
Gatling: 10 concurrent users, also 60 seconds
Result: 27 TPS(cnt/s?)
Question:
first I want to confirm the terminology of Gatling; in Gatling result chart, I see a column named "mean cnt/s" I hovered over it and it says "count of event per second", I imagine that's the same thing as Jmeter's TPS?
Jmeter:
summary + 2386 in 00:00:16 = 153.1/s Avg
Gatling:
Mean cnt/s: 26.652
if above assumption is correct, can someone share some insight on why Gatling's number is much lower than Jmeter's?
Thank You!
Gatling: 10 concurrent users, also 60 seconds
Do you understand what this does?
This is going to spawn a new user every time an existing one finishes, and hence create new connections. Assuming it takes 100ms for a virtual user to complete the scenario, you're going to spawn 101060 = 6,000 virtual users and as many connections.
Is that really what you want and is it the same thing as you do with JMeter?
If you actually want the same 10 users to loop for 60 seconds, you have to inject atOnceUsers(10) and add a during(60) loop in your scenario.
https://gatling.io/docs/gatling/reference/current/core/injection/#open-model
https://gatling.io/docs/gatling/reference/current/core/scenario/#loop-statements
Many things can cause deviations.
I assume you use the same setup for both in terms of load generator/target insance. You can start with fixed number of requests first.
Use loops in Jmeter and repeat in Gatling.
Sending for example 60 x 10 = 600 requests in total.
Gatling will be able to generate much higher load than Jmeter if properly used.
I created a simple test of calling an HTTP endpoint, that is configured to spam 1000 requests at once as it is in this picture:
The test took 75 seconds to run which means the throughput should be 1000/75 = 13.3 requests per second however, the Summary Report says it is 4.8 requests per second.
Why?
which means the throughput should be 1000/75 = 13.3 requests
According to the 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).
So it should be something like: 4150 / 75 = 55.3, however given you have 1000 threads and no loops you should have 1000 results only so try "clearing" the results and re-running:
Also consider running your test running JMeter in command-line non-GUI mode as GUI mode is supposed to be used for tests development and debugging, when it comes to test execution you should not be using JMeter GUI
I have a task to create profile load on the app. Profile load: Vuser 7 , 50 requests per hour. Create load dinamics: ramp-up 2 min , loading 20 min , end of loading 2 min. How to calculate this and choose thread group(and timer)?
Your test looks rather weird as 50 requests/hour is less than 1 request per minute and it is unclear why do you need 7 users and ramp-up/ramp-down periods.
No matter.
The easiest way of implementing your "load pattern" is using Ultimate Thread Group. It is not a part of normal JMeter distribution, you need to install it using JMeter Plugins Manager. The relevant configuration would be something like:
The easiest way of slowing down the requests to 50 request per hour is using Precise Throughput Timer, the appropriate configuration for your scenario would be:
You can check the actual throughput and the number of executed samplers using i.e. Aggregate Report listener. Given your test scenario lasts 24 minutes you should have around 20 sample results.
I have created a set and just confused with the Loop Count and Ramp Up period.
I have a test set with the following parameters.
Threads = 30
Ramp Up Period = 30
Loop Count = 100
As per the page on
quora.
I suppose:
a) If Loop count is Zero, then each of the 30 threads will be starting every second. As per the shared the web page, I guess 30/30 * 100 ie 100 threads/requests will be hitting the server every second. Please correct me if I am wrong.
b) As per the above parameters, there will be a total of 30 * 100 threads/requests. Does this mean all the 3000 threads/requests will be sent within 30 seconds [ Ramp Up period ]
Assuming you have 30 users and 30 seconds ramp-up
JMeter will start each virtual user each second
Each virtual user will start executing samplers upside down (or according to the logic controllers, if any) as fast as it can (if you don't use timers) so the delivered load can be either more or less than 30 requests/second, it depends on how fast JMeter is executing requests and on your application response time as JMeter will wait for response from previous sampler before starting new one
When virtual user finishes executing all the samplers defined in test plan it will start over and do point 2 for 99 more iterations
When virtual user won't have more samplers to execute and loops to iterate it will shut down
A couple of tips:
You can use Server Hits Per Second listener to see how many requests per second you are actually making given your test plan configuration
You can control the number of requests per second via Constant Throughput Timer
Consider upgrading to JMeter 3.2 as newer JMeter versions normally contain new features, performance improvements and bug fixes
according to jmeter manual ramp up is:
How long JMeter should take to get all the threads started.
If there are 10 threads and a ramp-up time of 100 seconds, then each
thread will begin 10 seconds after the previous thread started, for a
total time of 100 seconds to get the test fully up to speed.
So if your goal is to reach 3000 request within 30 seconds the above wont do, it might take more than that depending on how much it takes to finish the requests you are sending.
If you are looking for Throughput you can add an aggregate report listener which calculates the throughput for you and depending on the results you can configure your thread properties to reach your goal.
Reference :
Jmeter user manual
I am running my load test for a duration of 1 hour,in between the test I want a scenario to run for a duration of 1 minutes at regular interval of 15 minutes.
In jmeter,currently I am able to simulate for all the others scenarios except for the burst mode.
How do I keep the delay for 15 minutes and trigger the request for duration of 1 min?
How do I achieve the TPS for the burst? Currently I have to manually trigger jmeter script.
I would suggest doing the following:
Add a separate Thread Group.
Configure ramp-up and thread count as required.
Add a Constant Timer, set Thread Delay to 900 000 (15 minutes = 900 seconds, 1 second = 1000 ms)
Add a Runtime Controller, set Runtime to 60.
Add a Loop Controller, set Loop Count to Forever.
Place your burst test logic under the Loop Controller.
If you need to define requests per second rate during spikes use Constant Throughput Timer
I came here since I had the same issue or similar issue of "simulating" burst like request during the load test. I tried to follow the accepted answer but didn't get it to work (perhaps I misunderstood some steps), anyway; I based my solution in #esteveavi comment Loadtesting in burst mode in Jmeter from the original post above. And ended up using JMeter's "Ultimate Threat-Group" plugin with something like the following test plan set up: