Jmeter - Variation in count of different http requests within same thread group - jmeter

Requirement: Load for a total of 100 users within an hour. Each user hits 3 different services different number of times at the same time.
for example: user 1 is going to hit service1- 3 times, service2- 5 times and service3 - 4 times at the same time. Same will be repeated for 100 users over 1 hour.
I have a thread with users-100, rampup time -60 (min). and then I am using parallel plugin and within that plugin created those 3 different sample requests. But I don't know how to configure the number of times, each of those service will be called per user at the same time.

Your test scenario doesn't make sense, normally 1 thread (virtual user) can hit only one endpoint at a time. The use when user executes 3 same requests to the same endpoint looks very suspicious as well. So I would recommend reconsidering your scenario and implement distribution using one of the following approaches:
Use different Thread Groups for different requests
Use Throughput Controller
Use Switch Controller
Use Weighted Switch Controller
If however I'm wrong and you're trying to implement some form of AJAX testing when requests are being triggered at the same time and in parallel - example test plan would be something like:

Related

How can I put 2 scenario's with more then 1 flow in jmeter?

Customer has 2 scenario's. Both have more then 1 flow.
For example.
Tickets
a. Buy Tickets: 1500 concurrent users
b. Browse the website: 1500 concurrent users
View
a. Flow 1: 750 concurrent users
b. Flow 2: 750 concurrent users
c. Search the website: 500 concurrent users
Scenario 1 must be run before scenario 2 can be run.
Now is my question: how can I put this in Jmeter?
Normally you should use different Thread Groups to represent different groups of business users. If you need one Thread Group to be executed before the other(s) either go for setUp Thread Group or tick Run Thread Groups consecutively on Test Plan level, this way Thread Groups will be executed upside down
If you need yet another level of distribution inside the Thread Group you can use Throughput Controller which controls how often its children will be executed. So if you put 3 flows under 2nd Thread Group you can use:
2000 threads (virtual users) in total
Throughput Controller 1 - 37.5% of threads will be executing flow b
Throughput Controller 2 - 37.5% of threads will be executing flow c
Throughput Controller 3 - 25% of threads will be searching website
Example test plan outline:
More information: Running JMeter Samplers with Defined Percentage Probability
It's important to note that, although the mentioned techniques will work in terms of configuring the number of VUsers, they will not guarantee that the Avg TPS per requests will match the same proportion. I've mentioned this in another post:
"It's common a misconception when trying to achieve a targeted percentage of requests to instantiate Vusers in the same proportion. This only works if the Avg Response Time (ART) of each type of request is the same. It's very unlikely that, for example, the search request ART will the same RT as the registration request. As a consequence, after executing the test for a certain amount of time the actual proportion of requests (of each type) will be the different than the targeted request proportion."

How to run one sample multiple times independent of the number of threads in Thread group in jmeter

i have the need to run one http request sample more times than the rest of the samples in the Test group, for example, i need to run for 10 users, but for each of them, i need to run one of the samples multiple times, lets say 10, is there a way to achieve it?
1) I set "Number of Threads (Users)" in Thread group to 10, so i have 10 total users (with data taken for every thread from a CVS file, with equal number of rows and threads, so 1 thread is an unique data set.
2) I make some requests after, but for only one of the requests, i need to make it like 100 times in parallel for the same data for every thread, so in total, i will make 1000 (100 http requests for 10 unique users/threads) requests to that endpoint
Thanks in advance!
Edit: I found the loop controller, but its not making the 100 http requests at the same time for each thread in the thread group, it makes another one when the first ends
If I correctly got your requirements, to wit:
You need to execute one sampler more times than other samplers
The execution must occur at exactly the same moment
The most obvious choice would be either Parallel Sampler or Parallel Controller (depending on the nature of your requests). You can install both test elements using JMeter Plugins Manager:

How to prioritize multiple controllers in Apache JMeter

I have a requirement in JMeter, while executing several recorded HTTP Request (placed inside Transaction Controller) in Thread Group, They should start its execution from one by one ie) Controller 1, Controller 2, ... & Final Controller.
But when I gave 100 threads it start execute, Controller 1 for 100 times then Controller 2 for 100 times and it continues the same till last controller.
From the above shown image you can verify my results. And I need to know, how can I prioritize my controllers when I gave multiple thread counts. My exact output for 100 threads should be like as mentioned below,
1. Controller 1, 2, and till final controller should run as 1st thread count
2. Controller 1, 2, and till final controller should run as 2nd thread count
3. Same like it should continue till the 100th thread count
Please let me know how this requirement is possible in JMeter 4.0
Thanks in advance
This is default JMeter behaviour, JMeter threads (virtual users) are absolutely independent so:
When you start your test with 1 user it starts executing Samplers upside down, one by one
When you start your test with 100 users - all 100 users start executing samplers upside down. And given you have 100 concurrent users it might be the case that first sampler is being executed by multiple users at once.
Normally this is what the majority of people require. If you got the requirement to run all requests by 1st user followed by all request by 2nd user and having 100 users in parallel - suggest the person, who gave you this requirement to quit IT and become a lawnmower as the requirement doesn't make sense and is contradictory.
You can still achieve it using Concurrency Thread Group configured like:
Which will give you what you're looking for:
You can install Concurrency Thread Group using JMeter Plugins Manager.

How to control no. of requests per user in Jmeter

I am doing load testing for one ecommerce website. I am using Ultimate thread group.
Now I want to send per user only 1 request. So for ex: If 500 users then only 500 request should send. How can I achieve it using Ultimate thread group?
Why I want above because I am doing whole process like login, select product, add to cart and checkout. So it should do everything only once per user.
Your test design is a little bit flaky as given each user does login, select product, add to cart and checkout you will have at least 4 requests per user which gives 2000 requests in total (doesn't include embedded resources calls). You can use Transaction Controller to group these requests into one "workflow" however it won't limit actual amount of requests.
If you need to run your workflow by each user only once you may run into a situation when either load will be less than 500 concurrent users or test duration will be less than 30/60 minutes, see JMeter Test Results: Why the Actual Users Number is Lower than Expected
If you add more iterations each user will be executing your workflow more than once
Normally web test plan should look as follows:
Given each user executes test scenario steps and acting like a real user
Gradually increase the number of users unless application response time becomes too high or errors start occurring, whatever comes the first
Analyze results, identify the bottleneck, report your findings
Lets say the duration of the test is 1 hour. First user completes the workflow you had mentioned in the first 10 mins itself. What should happen after the workflow for the user? Should the thread be idle for the remaining 50 mins?
I think you should use the regular Thread Group with 500 threads and loop count as 1. Ultimate Thread Group is for duration based tests. You could use Once Only Controller as a workaround inside to do the action only once for the user. But it is an ugly approach.
You can use Throughput Controller.
The Throughput Controller allows the user to control how often it is executed. There are two modes:
percent execution
total executions
Percent executions
causes the controller to execute a certain percentage of the iterations through the test plan.
Total executions
causes the controller to stop executing after a certain number of executions have occurred.
Like the Once Only Controller, this setting is reset when a parent Loop Controller restarts.

Simultaneous users for web load tests in JMeter?

I have made some PHP scripts and I want to test the response time for simultaneous users in JMeter. This scripts are run in a very short time (50 miliseconds).
What I would like to do is to simulate a load test from 1 to 50 of users where each user (thread) repeats the request for an unlimited period. So first we will have 1 user, after 2 simultaneous users, after 3 ... and so on.
I am trying to do it but with I have is response times where it is evident that there is no simultaneous request.
With HP loaddrunner we can define number of iterations for each thread, is this possible in JMeter?
You can possibly use these 2 thread group implementations
Stepping Thread Group
Ultimate Thread Group
from Jmeter Plugins package, that let you set load-increase for you scenario as you want.
As well you can also look onto Synchronizing Timer if you want "better" concurrency - but this is rather stress-testcase than load one.

Resources