How to create proper JMeter workload model - jmeter

How to create proper workload model in JMeter if I have only number of concurrent users and response time as input/requirement? Do I need any additional information in order to load test app?
If these are only info I can get, how to approach load testing in context of using JMeter as load testing tool, any ideas - suggestions - advices?

A "proper workload" would be simulating real life usage of the system under test by "the number of concurrent users".
Just replicate real user behaviour at HTTP protocol level paying attention to pretty much everything i.e.
JMeter's network footprint must be exact replica of the browser's network footprint when it comes to HTTP requests so cross-check the number and the nature of the requests from browser developer tools and JMeter's View Results Tree listener
Make sure to send the same/proper HTTP Headers
As a subset of point 2 pay attention to Cookies
Make sure to download embedded resources like browser does
In addition to point 4 make sure to properly handle cache
Use Timers wisely to simulate think times
If your users are doing different actions configure your JMeter test to distribute them like real users are distributed
Once done just run your test with the anticipated amount of users for the desired duration and compare the real response time against the anticipated

The Avg RT and other KPIs (such as Throughput) are the result of generating or executing the workload with a determined # of VUsers. IMO, the best approach is to generate the load by varying the VUsers as shown in the graph:
This graph also shows a key concept: perfomance (as measure by KPIs) is not linear (although it might appear linear at a small # of VUsers).

Related

Is there a specific way to achieve the below scenarios in JMeter ? if yes how?

Can someone guide how can I achieve below scenarios via JMeter
1.Check if system is able to process 1,00,000 random searches per hour
2.Check if system can accept 1,00,000 transaction's per minute- this is more like form submissions
First of all you need to implement your test scenarios (search and submitting forms) using HTTP Request samplers
The HTTP Request samplers can be:
Recorded using JMeter's HTTP(S) Test Script Recorder
Recorded using JMeter Chrome Extension
Created manually basing on your application/endpoint specifications
Once you have test project skeleton and perform necessary correlation of dynamic values and parameterization of dynamic parameters like usernames you can start defining the workload, i.e. see Building a Web Test Plan user manual chapter
Add as many virtual users as needed, run your test and see whether your application can handle the anticipated load.
Suggested scenario:
Increase the load gradually, i.e. start with 1 user and increment the number of users till the projected amount
Look at Transactions per Second chart and Active Threads Over Time chart. On well-behaved system the throughput (number of requests per second) should increase as the number of users increase.
If you detect the point when you increase the load but the throughput doesn't increase - it means that the system reached the maximum performance. If it is sufficient - you can report the test as passed, otherwise you will need to investigate the root cause and either report or fix it if you're capable of doing this.

What should be the expected value of SD,Throughput,Median,Error percent in Jmeter test plan

I have created a test plan in Jmeter and ran it for 10 users, it has run successfully without any error, as in the below screenshot of the listeners which I have added in my test plan.
In the above listeners, how may I come to know that the values of these fields Standard Deviation, Throughput, Median, Error% calculated as expected Or is there any ideal/expected/benchmark values of the above fields through which I compare and found that my test plan work as standard. Moreover how may I able to explain that the performance of my test plan is fine/good/better or best
Please suggest me thanks
It sounds like you don't really understand what you're doing so I would recommend starting with i.e. Performance Testing Guidance for Web Applications e-book.
With regards to the "values" - we have no any idea whether the "values" match your expectations. There are no any reference "values", normally your project should have non-functional requirements or SLAs which should define maximum response time or minimum number of hits per unit of time.
Check out JMeter Glossary to learn what the "values" mean.
If you don't have NFRs or SLAs defined you still can perform a stress test like:
Make sure that your JMeter test behaves like a real browser, at least I fail to see:
HTTP Cookie Manager
HTTP Cache Manager
HTTP Header Manager
You should be running your test in command-line non-GUI mode
Start with 1 virtual user and gradually increase the load until
you see the saturation point
you start seeing performance degradation
This way you will be able to state what is the maximum number of users you system can support without issues

how much requests are made for 100 concurrent users on 5 page application on Jmeter load test

I am running jmeter tests with 100 to 1k users successfully,
But I suspect if response time is higher than expected.
My test plan include: get login and post login, get test page , post test page, get search page, post search page....
in total 5 get and 5 post forms.
For same number of users if I reduce number of pages the overall response time decreases
so should I run test for pages separately?
Should I reduce number of users for realistic numbers (5 pages*20 users=100 concurrent users)--for performance test?
Or should I be using distributed system?
What is the best practice?
Current Setup: i5, 8GB Ram, One windows machine with Jmeter 3.1
You load testing should be realistic, otherwise it does not make sense. You need to simulate anticipated users behaviour as closely as possible, only this way you will get the real life picture.
So you need to implement your test scenario to match the way, your site will be used in the real world. If it is alive already you can use Access Log Sampler to replay the traffic. If it is not, you can think about "user groups", like:
50% of not authenticated users will be browsing the site
20% of authenticated users will be browsing the site
5% of users will be in login process
3% of users will search for something
etc.
You can use different Thread Groups to represent different groups of users and Throughput Controller to control the frequency of samplers execution inside the Thread Group. See Running JMeter Samplers with Defined Percentage Probability article for more information on how to distribute the load in a realistic way.
There are N number of factors that will affect the overall response times. number of users / pages etc are also few of them. Do you have any specific requirement for performance test? If you are not sure of non functional requirements, then I think all your questions will be clarified in these posts -
http://www.testautomationguru.com/jmeter-performance-testing-application-of-littles-law-to-workload-models/
http://www.testautomationguru.com/jmeter-tips-tricks-for-beginners/
I think you could be running into jmeter issues. What is the JVM heap and GC algorithm that you are using? How are you measuring the performance of each page? If you are using "Transaction Controller" to measure the performance, any slowness in jmeter will affect your transaction controller values.
Have you correlated with the application logs to really understand that the application is indeed slowing down when you decrease the # of pages? If your application response time is constant, I think jmeter is the culprit here. Move all your measurements to the sampler level instead of transaction controllers and update the results

Recording application using template

I have recorded my web application through template & just to confirm that load test result which i am getting is correct? Just by increasing No of users does it give proper results? Is it enough for load testing of web application?
First of all you need to ensure that your test does what it is supposed to be doing. Recorded tests can rarely be successfully replayed, so normally you should be acting as follows:
Add View Results Tree listener and run your test with 1 user. Inspect request and response details to verify your test steps.
Perform correlation and parametrization if required.
Correlation: the process of identifying and handling any dynamic parameters. Most often people use Regular Expression Extractor for it.
Parametrization: the process of making your test data driven. For example, if your application assumes multiple authenticated users you need to store the credentials somewhere. Most commonly used test element for this is CSV Data Set Config
Make your test realistic. Virtual users simulated by JMeter need to represent real users using real browsers as close as possible with all the related stuff: cookies, headers, cache, etc. See How To Make JMeter Behave More Like A Real Browser to learn how to configure JMeter to act closer to real users. Also real users need some time to "think" between operations so make sure you are using Timers to simulate this behaviour as well.
Only after you apply the above points you should add more virtual users. Again, run your test with 2-3 users and iterations to ensure your test funcitons as designed. Once you are happy with it you can increase the load, but don't overkill your server, increase the load gradually and check the impact of the increasing load on your application, i.e. how response time, throughput and number of errors change as you increase the load. The same is applicable for decreasing the load, don't turn it off at once, decrease the number of virtual users gradually.
Building a Web Test Plan
Building an Advanced Web Test Plan

Reproducing load from access-log with respect to timestamp differences (Jmeter or similar)

Context
I am using JMeter with JMeter-plugins for load testing. So far I was either modelling the traffic myself (ramp-up periods, bursts, etc.) or just doing full load testing. Now, however, I need to reproduce the exact same traffic as was in the access log, so for example if I had three requests at, say, 13:00:01, 13:00:03 and 13:00:06, I will need the sampler to hit those respective requests in same timing, second one being 2 seconds after the first, and third one being 3 seconds after the second.
I surfed the web for solutions, however the only hint I got was to write custom LogParser to extract timestamps and time differences. However that doesn't cover the actual timing at which the sample will send the request, since this is stored in ThreadGroup.
Summary
This leads me to my question : how can I reproduce the same exact traffic (with respect to time differences between requests) as was in the access log? I don't want to model a similar one (like Gaussian etc.), I need an exact copy of traffic.
If it's impossible in JMeter, please direct me to the right tool.

Resources