My current environment: JMeter v2.11, remote Oracle 12, JDK 7
I have a soak test to generate in Jmeter and I'm unsure quite how to do what I need.
Essentially - I have a recorded script for 200 users to login to a web application within 1 thread group but I need to keep this going for 10 hours.
The http sessions will expire after 15mins, so I'm a little lost how to make the session restart once the http session has expired. I have had a think, I've played with 'Loop Count' settings on the thread group, I've googled for an answer, and I've searched on this forum but I haven't found anything that I can see is relevant (although I did find stuff that was quite interesting).
My current workings are as follows:
Thread Group - Number of Threads --> 200, Ramp Up --> 50, Loop Count ---> 1
--HTTP Request Defaults
--HTTP Cookie Manager
--Recording Controller
---HTTP Request - Login Page Launched
---HTTP Request - Username Input
---HTTP Request - Password Input
---HTTP Request - Login Button selected
---Some listeners
As with my previous posts - I am very grateful for any guidance anyone can provide.
Cheers!
JMeter works as follows:
It starts all defined virtual users (threads) within the bounds of ramp-up period provided. In your case it means that JMeter adds 4 new virtual users each second for 200 seconds.
Each thread executes samplers upside down as fast as it can. when sampler finishes its work and doesn't have more loops to iterate it is being shut down.
If you want your scenario to run over 10 hours set "Loop Count" to "Forever" and specify "Duration" on Thread Group level to be 36000 seconds as per image below:
In this case you'll get 200 concurrent users executing defined samplers for 10 hours.
Another option to specify test (or particular test part) duration is using Runtime Controller
Just in case if you need not 200 concurrent users but 200 requests per second, take a look at Constant Throughput Timer documentation.
Also JMeter acts on protocol level, it doesn't actually type anything into inputs or clicks buttons so my expectation is that you scenario should look as follows:
Open Login Page (HTTP GET)
Perform Login (HTTP POST)
Hope this helps.
Related
I need to run a load test of 25 threads, what will be the most efficient configuration to use? (ramp-up period....). I ran the load test with the below configuration and some of the threads failed but pass if I just ran the script individually.
Your configuration will mean that:
JMeter start with 1 thread and add another thread each 4 seconds
Once started each thread will begin to execute Samplers upside down (or according to the logic controllers)
When the thread executes the last sampler it will be shut down
When the last thread executes the last sampler the test ends
Depending on the number of samplers and application response time you may or may not achieve 25 users concurrency, you might want to check the actual number of concurrent users using Active Threads Over Time listener
If you want to make sure to have 25 online users set "Loop Count" to Infinite and "Specify Thread Lifetime" duration to be more than your ramp-up period. See JMeter Test Results: Why the Actual Users Number is Lower than Expected article for more details.
With regards to the failures - we cannot state anything meaningful without seeing request and response details, make sure to save them using i.e. View Results Tree listener and inspect response body for the failed requests
I have executed couple of Jmeter tests so far. My test plan in very basic one. I'm using Jmeter 5.2 on mac environment.
Number of threads: 500
Ramp-up period: 1
Loop count 3
[x] Same user on each iteration
[ ] Delay thread creation until needed
[ ] Specify thread life time
Basically according to my configuration above, the test will have 500 different threads being spawned in my JVM while this load test is running.
In order to create 500 threads, Jmeter has time restriction of just 1 second only. So, it will create the one thread in each 0.002 seconds from the moment I start the test.
I'm just hitting to an deployed publicly available service with HTTP POST request with a valid payload.
Now my real question
It is possible that the very first request that Jmeter sends will get the response from the server in just 0.2 seconds(200ms). What happens to that thread from that moment? Will this thread being killed after that?
Ramp up period doesn't stop thread, setting Duration will stop(/kill) thread if reach duration time,
Each thread execute independently until it finishes his last loop,
So in your case each thread will end after ~0.6 seconds (0.2 second per request * 3 loops)
It is possible that the very first request that Jmeter sends will get the response from the server in just 0.2 seconds(200ms) - yes, it may be even less, the question is whether your application can respond in 200 ms or less
What happens to that thread from that moment? Will this thread being killed after that? - for particular your set up if there are no more Samplers to execute the thread will execute this HTTP Request sampler 2 more times and after that it will be asked to stop.
You can increase JMeter logging verbosity to whatever level of details you want and inspect jmeter.log file in order to get the idea regarding what's going on under the hood of JMeter. Basic details can be obtained without any configuration tweaks:
I am trying to perform load testing on NodeJS application, the application allows single login session for an user.
But, when i tried to perform load testing with 8 concurrent users (using the same credentials) it was working.
So, i tried to create 10 user IDs and added to the CSV file and configured "CSV Data Set Config" and "HTTP Cookie Manager" and set the "Number of Threads" to 80.
When I run the test plan, the credentials are not passed to each sessions equally. for example, userID1 is passed 3 times and userID2 is passed 7 times.
Can you clarify the reason for this behaviour and how to run the threads with each credentials (8 sessions for every credentials) from csv file ?
Make sure you have set the options for CSV Data Set Config as All Threads for Sharing mode and provide a minimum ramp-up period (say 1 second) so that each thread reads the CSV lines properly without clashes.
For the question why it worked 8 concurrent sessions , where you allow only single session from UI - My guess is you used the same credentials for all 8 users - so server might have considered it to be 8 parallel requests from the same user. It depends on how session is maintained. For eg., if it was with a session-cookie , then If you had 8 different cookies it might have failed. But this is only a guess, as I don't know how its done in your app.
JMeter acts as follows:
All threads are started within the bounds of the ramp-up period which you define in the Thread Group
Each thread starts executing Samplers upside down (or according to the Logic Controllers) as fast as it can
JMeter waits for previous request to finish before starting next Sampler
When the thread doesn't have any more Samplers to execute and loops to iterate - it's being shut down
If you observe the situation when this or that logic was used more than another, most probably the response time for the login was less.
You might want to check the size of the response as for successful requests it should be more or less the same and it might be the situation when the server returns HTTP Status code 200 but response body contains errors, to wit some logins may fail silently, if this is the case it makes sense to add a Response Assertion to add some extra checks, i.e. presence of "Welcome" text or "Logout" link or absence of "error" text or whatever.
What i could understand is you are trying to achieve 8 session each user.in order to do that you have to make 10 concurrent threads and 8 iterations that is how you will achieve 8 session for every credentials.
But of your requirement is to run 80 concurrent users then try to make 80 users and run the test.
I want to Baseline my application .It is having two transactions "Place Order" and "Add A Product To Favorites".. Both of these transactions follow the same navigation route mostly. For the - Place Order Business Transaction the steps are Land on Login Page .. Login..Add To Cart..Checkout..Place Order. For the - Add A Product to favorites Business Transaction, the steps are : Land on Login page..Login....Add To Cart...Add to favorites. I want to run Test and see the consistent response time the application gives at a particular throughput. I have the below queries.
If I create Add to Favorites scenario as a Thread Group with 4 samplers and Place Order Scenario with 5 samplers(as given by the steps mentioned ), should I add a throughput Shaping Timer separately for the individual Thread Group and if so what would be the Throughput parameters that I should give like RPS settings.
My application has the following Max response time and avg response time for a normal Load(i.e with no queue wait time since I collected the response times by just running a single thread so that the Wait time component is Zero) .N.B L I have not added the think time for simplicity sake and also the response times are bit too costly since the backend ERPs are legacy systems.
So, the Thread Group that I will create for "Place Order" has http samplers below with their respective response times for a 1 user load:
Land on Login page - 6074 ms (avg 4492 ms)
Login using Credentials - 2549 ms (avg is 631 ms)
Add To Cart - 1553 ms (avg is 304 ms)
Land on Cart page: 47044 ms (Avg: 15901 ms)
Place Order : 19126 ms (avg is 17110 ms)
Logout : 4801 ms (avg is 2706 ms)
Below are my queries:
With the above response timings what is the max throughput i.e Place Order transactions that I can achieve so that I can set that as the TPS parameter in the Throughput shaping graph plugin and then run a load test. Please can somebody explain the calculation process to arrive at that value.
The same samplers (i.e Land on Login Page and Login and add to cart ) is used in multiple Thread Groups like the Place order Business Scenario above and the Add A Product To Favorite Business transaction . So my question is, if different Thread groups are going to pound the same Login Controller Servlet/Add to Cart Servlet (my app is a J2EE app) so how to take that into consideration so that the queue generated for the Login sampler will not affect the TPS to be achieved by place order Business scenario and the other Business scenarios that use the login sampler transaction since we will be running both the Thread groups.(One for Place Order and One thread Group for Add to favorites) while running the Load test
How to set the concurrency for a Thread group; say the Place Order Transaction .I have this question since we need to know the max response time. Hence should I add the entire response times of all the samplers in the Thread group and multiply by the TPS that we calculated and divide by 1000 .Please explain the logic in this case too.
Nobody apart from you can answer, from your numbers we can state that 1 user is capable of executing 1 Place Order request in 19 seconds or 3 Place Order requests per minute. If you add one more user there could be 2 cases:
Response time remains the same. In this case you will be able to execute 6 requests per minute with 2 users, 9 requests per minute with 3 users, etc.
Respons time increases. In this case you will NOT be able to execute 6 request per minute with 2 users due to performance bottleneck.
Check out What is the Relationship Between Users and Hits Per Second? article for more details.
I don't think you should be measuring various business use cases separately, well-behaved load test should represent real-live application usage as close as possible and in reality it is more than possible than one user creates and order while other users are logging in. However if you explicitly need to test order creation separately you can perform login in setUp Thread Group and then pass the authentication context (in majority of cases it is a set of Cookies) to the main Thread Group where the order creation takes place using i.e. Inter-Thread Communication Plugin
You don't need to know response time, you need to provide enough virtual users in order to conduct the required load (given the application is capable of handling it), consider using Concurrency Thread Group which can kick off extra threads if the current amount is not enough for maintaining the desired throughput. It can be connected with the Throughput Shaping Timer via Feedback function.
I have Simple scenario:
Thread Group - One user sign in
- HTTP Sampler for Sign in
- Loop Controller - count as 10
- HTTP Sampler for check page
As per the logic, it is working fine for 1-time sign in, 10 times check the page.
But if I give the same with 10 Users sign in, 100 times from check page, it is not sending all the requests to the server.
It is sent only around 60 to 70 request for check page. other requests are not sent from the JMeter.
Server side CPU usage getting 100%, is it restricting the JMeter to send the request further?
Scheduler Enabled in Thread Group restricted the Test running time with the argument Duration.
Scheduler Configuration set for the duration of 600 seconds causing the test to stop before all the iterations completed, which are still running.
Removing Scheduler Configuration resolved the issue and all iterations ran.
Note: The issue is identified after long discussion in the chat with the user. so question may not contain all the details.
following are some of the configuration he did in Thread Group:
Duration field: ${__P(duration,600)}
Delay : ${__P{delay,0}}
removing them resolved the issue.