I am performing load test of web component which receives files from users and later sends them back on demand. For this I am uploading files to web component with maximum number of concurrent users. I want to simulate an environment where:
100 simultaneous users will be sending continuous upload file requests to some web application. There would be delay of exactly 1 second between two consecutive requests from same user regardless of last request sent by same user is completed or not. In short 100 users will send upload file request simultaneously, then each user will wait for 1 seconds and again all 100 users will send next upload request and the process continues. I want to make this configuration with help of Jmeter.
User(1) => Send upload request, wait 1 second, Send upload request, wait 1 second, continue..
User(2) => Send upload request, wait 1 second, Send upload request, wait 1 second, continue..
User(3) => Send upload request, wait 1 second, Send upload request, wait 1 second, continue..
.
.
.
.
User(100) => Send upload request, wait 1 second, Send upload request, wait 1 second, continue..
Currently I have structure:
ThreadGroup(Number of Threads: 100, Ramp up Period: 1 second, Loop count: Forever)
----HTTP Header Manager
----HTTP Request
----View Results in Table
But each next iteration of loop waits till last iteration's requests are served successfully. I want to change this behavior so that next iteration will start even if last iteration's requests are not served yet.
Any help/suggestions/improvements are appreciated.
Use Timer in between requests
http://jmeter.apache.org/usermanual/test_plan.html#timers
Related
May i know how to achieve this scenario in JMeter.
Requirement 1 : Request 1 should execute for 15 mins, once 15 mins crossed request 2 should execute and request 1 to be stopped.
Requirement 2 : In request 1, we need to capture all dynamic value and store it some place and same dynamic value we should use it as request body for request 2. We like to run large numbers of users. Not sure, how to store all the response in some files or other alternatives.
Ex : Request 1 - > Trigger -> Store response somewhere(15 min run & 100 iteration) - stopped
Request 2 - > Trigger after 15 min - Execute request with above 100 iteration response)
Either take a look at Runtime Controller, using this guy you can choose how long its child(ren) will be run or just put your requests 1 and 2 into separate Thread Groups
If you want to store full responses into a file take a look at:
Post-Processors to capture the required part of the response into a JMeter Variable
Sample Variables property to tell JMeter to save this variable into .jtl results file
Flexible File Writer if you want to write the values into a separate file
I have a Login transaction where in this there are 10 requests. I have added a Uniform random timer for Login transaction for 2 to 3 seconds. i.e all these 10 request will wait for 3 seconds before sending the request as below.
wait for 3 seconds sends Request1
wait for 3 seconds sends Request2
wait for 3 seconds sends Request3
and so on.
So my question is does Jmeter waits for the response before sending the next request. i.e will Request2 waits for the response or will Request3 is sent after 3 seconds irrespective previous requests response. in this case Request2's response.
Please help in this.
Thanks in Advance,
JMeter will wait for response from previous request prior to sending next request in any case. In normal conditions it would look like:
Request 1
Request 2
Request 3
...
See A Comprehensive Guide to Using JMeter Timers article for more information on how Timers work.
By adding a Timer you create a "sleep" before each request, it will look like:
Sleep 2 - 3 seconds
Request 1
Sleep 2 - 3 seconds
Request 2
Sleep 2 - 3 seconds
Request 3
...
However as per documentation:
Each thread will execute the test plan in its entirety and completely independently of other test threads. Multiple threads are used to simulate concurrent connections to your server application.
So if you have > 1 thread you may run into the situation when different threads are executing requests at the same time (which is the main point of load testing).
I have 1 thread group with 4 HTTP requests, each using separate csv to get input(json).
I want to run load testing with 100 users for 10 loops for all of them.
Expected result: run HTTP request 1 for 100*10 times then move to HTTP request 2 and run 100*10 times and so on.
First HTTP request is provided with correct values and second with incorrect values, So first HTTP request gives 0% error and 2nd thread gives 100% error.
Issue: While running thread, 2nd HTTP request is also giving 0% error instead of 100% as it is somehow picking values from same csv as the first HTTP request(they both have separate CSV data set config with separate csv files having different data), while they are working fine individually.
My test plan
CSV Data Set configuration
In the same Thread Group all threads will be running simultaneously, there's no configuration option that would allow HTTP requests in the same thread group to run sequentially. So you can fix it in one of the following ways:
Put each HTTP request in its own Thread Group, and use Run Thread Groups Consecutively option
Thread Group 1
HTTP Request 1
Thread Group 2
HTTP Request 2
...
Use controllers and timers to get each HTTP request executed in loop and all threads to wait before starting the next one:
Thread Group
Loop Controller <-- set Loop Count to 10
HTTP Request 1
Synchronizing Timer <-- set Group by parameter to 100, so you wait for all threads to finish with first loop
Loop Controller
HTTP Request 2
Synchronizing Timer
...
I need to test a REST method for saving an object. In order to have the ability to save it I need to request an authToken that is updating each 100 seconds.
Right now I have a thread containing both requests , and the login request is executed each time the saving does. How can I make the login execute once at the start of the thread and then each 100 seconds ?
P.S. I've tried separating it in 3 threads , one for the initial login , the other with a loop and a 100 seconds timer and finally the one with the actual test. It does work ,but it seems like a bad solution.
How about:
|-Login
|-Loop n times
|-Save
n being number of times that will be just about less than 100ms?
or
|-If login valid?
| |-NO: Login
|
|-Save
option 3:
ThreadGoup1
|- Login
|- Beanshell update shared token
|- Constant throughput timer
ThreadGroup2
|- Beanshell fetch shared token
|- Save
A constant throughput timer allows you to run at a set throughput. Once every 100 seconds is 0.6 samples per minute, I'm not certain you can do fractions, but even 1 sample a minute should work for you.
I am currently using JMeter to simulate 5 users firing requests every 40 seconds. I have created 100 different requests but after every 40 seconds, each user is firing all 100 requests. I want to make it in such a way that after every 40 seconds, each user only fires 1 request and that request has to be different from the previous request. I would like to know what kind of controller to use (or anything else) to achieve this scenario.
Thanks
Try to use Random Controller.
The simplest way to implement your scenario:
Thread Group
Number of Threads = 5
Loop Count = N
. . .
Random Controller
HTTP Request 001
HTTP Request 002
HTTP Request 003
. . .
. . .
HTTP Request 100
Test Action
Target = Current Thread
Action = Pause
Duration = 40000
. . .
This will iterate 5 threads N times.
Random Controller will RANDOMLY pick up on each step http request from "requests pool" - all the samplers added as children to Random Controller.
Test Action will pause thread for 40 secs.
Updated:
working illustration for above scheme:
Thread Group
Number of Threads = 5
Ramp-Up Period = 0
Loop Count = 10
Constant Timer
Thread Delay (in ms) = 40000
You can download working example for described scheme from here: rc-plan.jmx.
This one works how you want (at least for me, Jmeter 2.5.1): it picks randomly ONE request from requests pool (in example - 10 requests) for EACH user (here - 5 users) on EACH step (here - 10 loops) and pauses each thread for 40 secs (Constant Timer).
You can also look into this mailing archive: Is their a way to randomize URL selection?.
Situation similar to your one seems to be described here.
...As per official documentation "Interactions between multiple controllers can yield complex behavior. This is particularly true of the Random Controller."
Another option for you may be to create a CSV file with parameters for your requests ahead of time and use CSV Data Set Config to parameterize a single http request.
That obviously depends on how different your http requests are, but if it fits your requirements there are some potential bonuses with maintaining 1 http request in your test plan vs. 100.
The other details would be the same as #Alies Belik laid out -- one thread group configured for your required number of threads and loops, with a constant timer at the end for your 40 second pause.