I am testing a website for load test having following pages
Home Page
Login Page
Blog Page
Selected Blog Page
Post on Selected Blog
I want to send request for each page at same time with different number of users. At now i am doing this in following way
Thread 1 (user 500)
Home Page
Thread 2 (300 user)
Blog Page
Thread 3 (100 user)
Selected Blog Page
But when i use login functionality, then how can i achieve this task because login requests sets some cookies data and other information about user and Post page also need some data from Selected Blog Page.
I want to achieve following:
Lets suppose 500 user logged-in then 300 user should hit Blog Page, 100 user hit Selected Blog Page and 100 User hit the Post on the Blog Page , but all things should be at same time.
I see 2 ways with some assumptions,
Assumption : by saying Thread you mean Threadgroup and you have 3 threadgroups each with only 1 request i.e.
Threadgroup1
home Page
Threadgroup2
blog page
Threadgroup3
select blog
Options :
For each threadgroup you can make simultaneous load by making rampup time 0,delay 0. By doing this Jmeter will start all threads(users) at a time.
use Synchronization timer (standard way) : this will block no. of threads till a count is achieved and then releases all threads at once to generate heavy load at a given point of time.
Scenario 1 would be,
each threadgroup with reqd no of users and rampup 0
Scenario 2 would be,
single threadgroup with max no of users but before each req. synchronization timer which will wait for specific no. of users (100 for example). read help about synchronization timer.
Related
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'm using Jmeter to load test an application.
No: of threads is 100.
First HTTP request is the home page.
Second HTTP request is login page where the actual login is made
.
.
n APIs are there.
and what I want to achieve is:
First 100 threads hit the home page concurrently.
Then 100 threads hit the login page concurrently.
.
.
Then 100 threads hit the nth API concurrently.
Add Synchronizing Timer as a child of each request which you need to execute "concurrently"
Set Number of Simultaneous Users to Group by to be equal to the number of concurrent users, in your case 100
Reference: Using the JMeter Synchronizing Timer
Although above approach answers your question better scenario would be starting with 1 virtual user and gradually increase the load, in this case you will be able to correlate increasing load with performance metrics like Response Time, Transactions Per Second, resources consumption of the application under test, etc. as the situation when 100 users open login page and then hit "Login" button at exactly the same moment is highly unlikely to happen and well-behaved load test needs to represent real usage of the application by real users as close as possible.
Threads number 100 ,You need to put each request with synchronizing timer under 3 controllers, See tutorial
my thread count is 100 and iteration count is 100 .50 users are registred users and 50 users are guest users.
home page -5%: This page should run for 5 % total hit of both guest and logged in user irrespctive of user type.
Login page- 50% : This page run for 50% of total hit.
Search page 20%- This page should run for 20 % total hit- This can be run for guest as well as logged in user.
product page 15%- this page run for 15 % total hit-This can be run for guest as well as logged in user and this prequest is using parameters from search page(3rd request)
Add to cart 10%- This page should run for 10% of total hit- For performing this request i need to make sure that user is already logged in user and parameters are captured from search page reques(3 rd request)
I wan to create test plan for the above condition
For me, the question itself is not fully understandable.
As it not possible in single Thread Group to achieve the requirements, Following is the Test Plan you can try out to achieve the dependencies along with the percentage of distribution. This is NOT a correct solution but I claim it as a probable solution. You can customize as per your needs.
Test plan
...Thread Group (configure 100 users)
......HTTP Cookie Manager
......Throughput Controller (by percentage throughput - 5%, uncheck Per User checkbox)
.........Home Page (Transaction Controller)
......Throughput Controller (by percentage throughput- 20%, uncheck Per User checkbox)
............Search Page (Transaction Controller)
......Throughput Controller (by percentage throughput- 15%, uncheck Per User checkbox)
............Product Page (Transaction Controller)
......Throughput Controller (by percentage throughput- 50%, uncheck Per User checkbox)
.........Login page (Transaction Controller)
............Login Request (HTTP Sampler)
.........Throughput Controller (by percentage throughput- 20%, uncheck Per User checkbox)
............AddToCart (Transaction Controller)
......Aggregate Report
Important Notes:
Added Throughput Controllers as a parent of Transaction Controllers to control the percentages. Uncheck Per User checkbox.
Transaction Controller contains the HTTP Samplers. eg: Login Transaction contains all the HTTP Samplers that are responsible for Login operation.
Add Aggregate Report listener under Thread Group, to capture all the request results.
Image reference:
I want to test multiple scenarios in a same website using JMeter.
For example I have 2 thread users.
I want..
>1st user performing 1st scenario: like login his account
>2nd user performing 2nd scenario: browse some other page
How this can be achieved in JMeter?
If you need 50% of users to perform login and 50% of users to browse the website there are following options available:
Use 2 separate Thread Groups:
Thread Group 1: with virtual users who perform login
Thread Group 2: with virtual users who perform browsing
Use Throughput Controller like:
Add Throughput Controller configured like:
Percent Executions
50.0
Add the relevant sampler(s) under the Throughput Controller (as child)
Do the same for 2nd, etc. scenarios
See Running JMeter Samplers with Defined Percentage Probability article for more detailed explanation of above and more complex distribution scenarios.
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.