I'm new to jmeter I have the following scenario. I want the jmeter to hit the given url, I have 13 such url in a csv file.
I want to hit the url at the rate of 2 requests per second for a given time period of 60 seconds.
In this case how should I specify my thread group, Ramp-up period and Loop count.
I understood the basic like 10 thread with 10 second rampup with a loop count of 1 will run 1 request per second for 10 user. But I'm not sure how to specify when we have 13 such urls.
Atleast any link for the given scenario is appreciated.
I understood the basic like 10 thread with 10 second rampup with a loop count of 1 will run 1 request per second for 10 user
not necessarily, JMeter waits for response from the previous Sampler prior to executing the next one, the configuration means that JMeter will start 1 user each second, it doesn't guarantee 1 request per second.
The easiest way of achieving X requests per second throughput is using Throughput Shaping Timer
Make sure to supply the sufficient number of Threads, i.e. if your application response time is 1000ms - 2 threads should be enough, if it's 2000 ms - you will need at least 2 threads, etc.
There is a special thread group: Concurrency Thread Group which can be connected to the Throughput Shaping Timer via Feedback Function so it will automatically kick off extra virtual users if the current amount will not be enough in order to conduct the required load.
Related
When I'm using the original JMeter Thread Groups and set 10 threads (users), it fires 10 external HTTP calls.
When I changed it to Ultimate Thread Groups (UTG) and set the following attributes...
Start Threads Count = 10
Initial Delay = 0
Startup Time = 60
Hold Load For = 30
Shutdown Time = 10
...it fires thousands of external HTTP calls. Even the Stepping Thread Groups (STG) and Concurrency Thread Groups (CTG) also behave the same as UTG.
Why this happens when using non-original JMeter thread groups? I'm looking for ways to create 10 users that create 1 external HTTP call each (means 10 in total for the whole test plan) using UTG, STG or CTG but I don't really understand why this happens.
Screenshots when using original Thread Group
Screenshots when using original Ultimate Thread Group
Your scenario results in:
On 5th second of the test 1st virtual users starts
Within next 55 seconds remaining 9 virtual users start
10 users are active for 30 seconds
Then each 1 second each 1 virtual user is being shut down
You're seeing much more than 10 requests because once virtual user is kicked off it starts executing Samplers as fast as it can and the actual number of executed Samplers will mostly depend on your application response time. Check out What is the Relationship Between Users and Hits Per Second? for more comprehensive explanation.
If your goal is to execute 10 requests in 1 minute 40 seconds you need to use Constant Throughput Timer or Precise Throughput Timer or Throughput Shaping Timer in order to limit JMeter to send 1 request per each 10 seconds.
I'm having a question about how the requests are processed,
For example:
I have created a test plan, with one thread group.
Set number of users (thread): 10
Ramp-up period: 20
Loop count: Forever
Within this thread group I have created 5 HTTP requests.
When I hit start, I understand that it starts with 1 user, and by 20th second it will have all 10 users.
Does each sampler (http request) get assigned to 1 user? Is each sampler fired in sequential order? Does it fire parallel requests? I am trying to understand overall working.
JMeter starts threads (virtual users) within the bound of the ramp-up period. In your case JMeter starts with 1 user and adds another user each 2 seconds.
When thread (virtual user) is started it starts executing Samplers upside down (or according to Logic Controllers)
When there are no more samplers left to execute the thread starts over (if the number of loops is > 1), otherwise it is shut down.
With regards to concurrency, it mainly depends on the number of threads and application response time, you can observe how many virtual users were online using Active Threads Over Time listener and the delivered load using Server Hits Per Second. The aforementioned listeners can be installed using JMeter Plugins Manager
Each thread is sequential firing HTTP requests based on your flow
But you are executing 10 threads/users in parallel, so the order of the requests in total isn't sequential, but parallel
If you defined loop count as 1, then each sampler (http request) would get assigned to 1 user,
But you are looping endlessly, so samplers can be executed more than once per user/thread
About Loop Count: (asked in comment)
Loop Count - the number of iterations for each Thread.
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 new to jmeter, I want to create a report, I have following doubts:
I want to find out the maximum number of users that can be given in a thread for ramp-up time 1sec?
Ex: 5 simple Http Request
no of user : ?
Ramp up time = 1
Loop=1
How to set a proper ramp-up time depending on the number of user in a thread?
Ex: 5 simple Http Request
no of user : 100
Ramp up time = ?
Loop=1
I tried different combinations of ramp-up and number of users considering through put , but the results varies and not able to find out a relation with the ramp-up time and the number of users.
Please help to find a solution for it.
Thanks!
Ramp-up period is the time required for all threads representing virtual users to start.
JMeter starts with 1 user and kicks off another thread so all threads will start in ramp-up period time slot i.e.
10 users, 10 seconds ramp-up - start with 1 user, each second 1 user added
10 users, 20 seconds ramp-up - start with 1 user, each 2 seconds 1 user added
100 users, 50 seconds ramp-up - start with 1 user, each second 2 users added
Keep in mind that if the thread has finished its job and there are no loops defined it'll shut down. For JMeter greenhorns it's better to use Ultimate Thread Group (available via plugin) which provides easy-understandable and configurable load pattern definition.
Depending on what you're trying to achieve you can also use the following test elements:
Synchronizing Timer - to hold the threads until specified number will be reached and release them at the same moment
Constant Throughput Timer - to specify exact load in requests-per-second.
Hope this helps.
I am trying to achieve goal of 3 TPS using all my threads. I used Constant Throughput Timer but somehow it doesn't provide constant TPS. It does go beyond 3 TPS like sometime 10TPS.
Test Scenario
Thread Group 1
This Thread group submit XML on server and check the status.
I put constant Timer under this Submit Quote action and set value as 3 per min.
After each Quote Submit i will perform some action.
Thread Group 2
This Thread group submit XML on Server and check the status as like first Thread group but the rest action are different than first.
I put constant Timer under this Submit Quote action and set value as 3 per min.
Thread Group 2
This Thread group submit XML on Server and check the status as like first & Second Thread group but the rest action are different than first & Second.
I put constant Timer under this Submit Quote action and set value as 3 per min.
I need 3 TPS from all these Thread Groups for Submit Quote step, i am able to achieve that somewhat but it's not constant.
Can some please help to manage TPS?
Below is the Graph you can see some high transactions:
CTT will give you "constant" throughput after some time, not in such reduced time as your test shows.
The peak you see come from variation of your server response time.
Maybe you can try this method:
Configure thread group :
Loop count = 1
Ramp up period = time of your test (3600 seconds for my example)
Delay Thread creation until needed = true
Scheduler duration = 3600 seconds
Scheduler startup delay = 0
if you run for 1 hour, to achieve 3 Trans per minute, set number of threads to 180.
I am able to manager this up to some extend by separating actions in to multiple threads. In my earlier example in Thread 1 i was performing some action which impacted CTT. To resolve issue, i am using Queue concept.
First separate your thread's, if any action in your takes time move them to separate thread. In below example actions QuoteStatus and further were part of my thread 1 and due to slow response from server it was not allowing me CTT.
If you look at above response time from Thread one its pretty constant, having multiple actions is one thread cause issues. If your goal is to put constant throughput, it would be good to keep one action each thread and then use Inter_Thread Communication to pass data in other threads.