Load distribution of transaction in JMeter - jmeter

During load testing can we achieve different transaction rate in same flow?
For example: I have a e-commerce web based application to do the load testing and I have to design the test in order to achieve TPH as below.
a. Transaction A: Login (100 transaction/hour)
b. Transaction B: Search Product (500 transaction/hour)
c. Transaction C: Payment (300 transaction/hour)
d. Transaction D: Logout (100 transaction/hour)
Could you please help me with Jmeter element configuration also?

You can use this component from jmeter-plugins 3rd party project:
https://jmeter-plugins.org/wiki/ThroughputShapingTimer/
It allows you to control throughput which. is what you're looking for here.

Your testing doesn't assume much load as 1000 requests per hour is less than 1 request each 3 seconds which is easily achievable either manually or using Selenium browser-based tests.
If for some reason you need to proceed with JMeter take a look at Constant Throughput Timer which can limit requests execution rate to the desired value.
Example configuration:
Add Constant Throughput Timer as a child of the Login sampler.
Add 1.66 to the "Target Throughput" input (100 requests per hour / 60 minutes in hour)
Switch "Calculate Throughput based on" dropdown to i.e. all active threads in current thread group so the throughput setting could be shared across all threads

Related

How to setup requests per second scenario on JMeter

My test has 1 Authentication API and 2 other API's. I need to run Authentication API once and other 2 API's to generate X request per minute.The Auth API should run first then followed by other 2 API's. How can I create this scenario in thread group.
Put your "Authentication API" (whatever it is) under the Once Only Controller
Constant Throughput Timer is a good option but be aware of several constraints, i.e.
it is precise enough on "minute" level, the throughput will be applied more or less after 1st minute of your test, prior to that you need to manipulate the ramp-up period
it can only pause the JMeter Samplers execution rate to limit it to the defined number of requests per second, it won't kick off any extra threads in case if current amount is not enough to conduct the required load
If you want to get the number of requests per second you set in the "Target throughput" make sure that "Calculate Throughput based on" is set to all active threads
In the majority of cases it's easier to use Throughput Shaping Timer or Precise Throughput Timer

How to get number of throughputs per second as 500 in jmeter

Good day.
I am new to J-Meter and here is the requirement I need to verify through J-meter TP.
I am using Jmeter: 5.1 version.
I need to get the results for 500 throughput per seconds.
Number of target users : 100
Time to run the test 1 hr.
Start the test with 5 users and increase the load by setting every 3 seconds 5 more users up to add till we reach reaching 100 users.
Once we reach 100 users >> Keep the load for 10 seconds hold and decrease the load by every 3 seconds to reduce 5 number of usrs.
Please help me on what are the parameters I have to set in J-Meter test plan.
Thanks.
Siva
The easiest way of controlling the number of requests per second (throughput) in JMeter test is using Constant Throughput Timer
Add Constant Throughput Timer to your Test plan and configure it to send 30000 requests per minute (500 requests per second)
Make sure that all the Samplers are in the Constant Throughput Timer's scope and you have all active threads selected in the dropdown
You can only achieve 500 requests per second with 100 users if your application response time is 200 ms or less, if it's more - you will have to increase the number of threads accordingly.
And last but not the least, according to JMeter Best Practices you should always be using the latest version of JMeter (5.3 as of now) so consider upgrading at next available opportunity
Below are some suggestions that might help you to start with:
You might need to calculate the pacing required to achieve target total transactions:
Pacing = 3600(Test duration time in seconds) * ( target no.of user) / (no.of total transactions to achieve).
To setup ramp up, ramp down more effectively you will need one of the plugin available in Jmeter Plugins Manager (Plugin name : Stepping Thread Group by blazemeter) which comes with a preview.
How to setup Plugins manager (https://jmeter-plugins.org/wiki/PluginsManager/)

How to Baseline a Web application using Jmeter

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.

How to count session/checkouts in jMeter

jMeter seems to be made to answer the question "how many parallel users can a server handle?"
That of course strongly depends on how fast the users browse the page.
What I would care about is "How many checkouts can the server handle per minute?"
So I've setup a click path that the users follow, from homepage to payment.
I slightly randomize click times (one click every 5-15 s), and use the plugin "jp#gc ultimate thread group" to step up the thread count every minute until the server fails.
What's the best way to get the highest number of checkouts per minute that was reached before the server died? Reporting seems to be all about concurrent users (threads), not taking thread restart i.e. new session into account.
There is Transactions per Second listener which plots throughput for JMeter's Samplers. If you're interested in the end-to-end business transaction - you can put all the associated Samplers under the Transaction Controller and tick both Generate Parent Sample and Include duration of timer and pre-post processors in generated sample so if you want to measure these "click times" duration of 5-15 seconds as well.
Transactions per Second listener can be installed using JMeter Plugins Manager

jmeter calculate page load time, the which type of thread to be used to observe the maximum load in which server is stable

I am new to jmeter and scripted for login authentication. Project requirement is to see the load for 10K concurrent users.
Script is working fine but to enhance I need suggestions on how to do the following thigs:
How can I see that how much time/average time the server takes to load a page.
which thread grp (studied Ultimate thread group but it is not very clear to me), should be used to see the maximum load the server can sustain in a particular time, for that rampup time need to be adjusted (correct me if I am wrong).
Please tell how to adjust the rampup time with respect to users/waiting time etc., in short how to do incremental/proportional observation to see the server performance(there is no Gateway error etc)
If you're looking for your server capacity boundaries I would rather stick to "requests per second" rather than to "concurrent users" as users may work with different applications in a different way.
For instance, if it is image gallery - the majority of users will be browsing images and do this rather frequently, for instance request next image i.e. each 2 seconds. Given image load time 1 second it will be an image per 3 seconds - 20 images per minute. In this case 10000 users will create the load of 3333 requests per second.
If your site is articles collection, users will need some more time to read an article, i.e. 2 minutes. In that case 10000 users will create 83 requests per second load.
JMeter provides Constant Throughput Timer out of the box, you can set desired target throughput in requests per minute using it. And once you're already aware of JMeter Plugins project, it offers Throughput Shaping Timer - more advanced test element with extended functionality.
If you go "throughput" way, no matter which Thread Group you choose as the load will be orchestrated by aforementioned timers.
See What is the Relationship Between Users and Hits Per Second? article for more detailed explanation.
Once you design your test scenario run it in non-GUI mode (as JMeter's GUI is very resource intensive) as:
jmeter -n -t /path/to/your/testplan.jmx -l /path/to/resultsfile.jtl.
When the test finishes, open JMeter GUI, add Aggregate Report listener and inspect min/max/average response times per requests.

Resources