How to implement load pattern in Jmeter load test script - jmeter

I have to develop a performance load test of a Web Server user interactions by replicating the real life load pattern, but I am not sure how to do it in Jmeter.
Here is my requirements:
To implement a 1-hour load test by replicating 24-hour period load pattern
(as listed below)
To simulate the real life load pattern, I have to continuously start
and stop user sessions (threads)
for example, I have to start the load test script with 20 virtual
users (threads) logged in (representing 00:00:00 AM load) and 10 virtual users logged out
then, continue until 03:00:00 AM when 5 more users will be logged out
the pattern will proceed with logging in and logging out as indicated in the
table below
Challenges:
I am not taking the straight forwardly the highest number of users (e.g. 200 users logged in at 11:00:00 AM) as my max. virtual users (or threads) to ramp, rather the threads will be started and dropped by replicating the pattern below.
Load pattern of user interactions for a typical 24 hour period:

The easiest way is going for Ultimate Thread Group where you can ramp up and ramp down virtual users in a very flexible manner
You can install Ultimate Thread Group as a part of Custom Thread Groups bundle using JMeter Plugins Manager
Check out How to Use the Ultimate Thread Group, the RegEx Extractor and the JSON Path Extractor in Apache JMeter for comprehensive information on installation and using of the Ultimate Thread Group

Related

How many concurrent users can run in JMeter in one machine

This is for e-commerce project where the number of users login will be more. I have been given a benchmark 8000 concurrent users need to login and response time should be 3 minutes
#abi , hi .
Let me provide couple notes here.
Depending upon Your connection bandwidth , from my experience as performance test engineer, I'd say jmeter single instance usually holds up to 1k(1000)- 2k(2000) in best case users load.
Considering You have a requirement for 8k (8000 users) load, You need to launch jmeter in distributed mode ( master <-> slaves).
For this config setup I'd recommend to go with 1 master node and 4slaves. For that - You will need 5 machines (aws/azure, whatever) in the same sub-network.
Re more technical details on distributed setup, please take a look:
in public jmeter documentation
please also look into this step-by-step setup manual
Also, when i've been doing set-up for 10k load for one of my recent projects - I did couple notes for myself in g-doc . Let me know if it opens fine for You.
Last note, If You need to do some load/performance tests on APIs that require AUTHZ, I'd recommend to split authorize (IDP bypass) and performance scenario itself - in different thread groups. As usually IDP in DEVs/Stagings does not hold much load .
So at first You need to authorize w/o any load (1st Thread group).
And in 2nd Thread group - start calling target APIs under the test.
It depends on:
Your machine specifications (CPU, RAM, NIC card, hard drive, etc.)
The nature of your Test Plan (number of requests, size of requests/responses, number of pre/post processors, assertions, timers, etc.)
Response time of your application
So if your test is a simple GET request which returns small text response - you might simulate 10 000 of users on a mid-range modern laptop. And if your test is connected with heavy requests, large responses, file uploads, etc. - it might be 1000 users.
Make sure to follow recommendations from JMeter Best Practices
Make sure to have monitoring of resources usage of your system (CPU, RAM, Swap, etc.). You can use JMeter PerfMon Plugin for this.
Make sure that your test behaves like a real browser
Start with 1 virtual user and gradually increase the load until you reach 8000 virtual users or JMeter starts lacking resources, whatever comes the first. If you can simulate 8000 users from a single machine - you're good to go. If not - you will have to consider Distributed Testing.

how to configure multiples logging in jMeter

I need to do performance testing where my scenario is 100 different user logging per day
You don't need any performance testing for 100 users as 100 users per day = 12 users per hour = one user each 5 minutes, any server will handle this "load", even if it is running on a Raspberry Pi.
In general if at some point of time you would like to know the limits of your application, i.e. what is the maximum amount of users it can handle - you will need to go for so called Stress Testing when you start with 1 user and gradually increase the load until response time starts exceeding acceptable thresholds or errors start occurring or website crashes whatever comes the first.
When it comes to using JMeter for web applications performance testing normally steps look like:
Record your test scenario(s) using JMeter's Proxy Server
Perform correlation if required (most probably you will need it as modern web applications widely use dynamic parameters for i.e. user state management or CSRF protection)
Given your test assumes > 1 virtual user you should be using different credentials for every user. Most often JMeter users go for CSV Data Set Config to read the data from external file.
References:
Building a Web Test Plan
Building an Advanced Web Test Plan
There is also an example test script available via File -> Templates -> Building an Advanced Web Test Plan entry of the JMeter main menu which you can use as a "skeleton" for your test

Using jmeter not all requests processed in database, but in jmeter listener shows all requests hits the server

Using jmeter, I have 10000 users need to hit the server and to respond back with in 40 sec.
During execution (in distributed mode) only 600 users really hitting (Checked in db) in server.
But in AGGREGATE REPORT it shows all requests hits the server.
What is the issue behind this? why the number of requests hits the server isn't consistent between db and jmeter listener?
Probably your test configuration is a little bit wrong.
JMeter acts as follows:
JMeter starts all the threads (virtual users) within the bounds of ramp-up period specified in the Thread Group configuration
Each thread (virtual user) starts executing samplers upside down
When there are no more samplers to execute and no more loops to iterate the thread is being shut down.
You can check how many threads were actually active using Active Threads Over Time Listener or the same chart of the HTML Reporting Dashboard
So you may run into a situation when some samplers have already done their work and some haven't been yet started. Basically you need to provide enough loops to make sure all 10k threads will be up and running for the required test duration.
See JMeter Test Results: Why the Actual Users Number is Lower than Expected guide for more information.

Performance testing with Jmeter

I've recorded a test script of web application (extJS). The test logs into application (I used login and password saved in .txt file and CSV Data Set Config element), makes some calculations with external webservice and adds some elements to database. It works fine but...
I'm not sure that all of my users do these things at the same time... Is there any way to configure it?
E.g 100 users do the same scenario at the same time?
You can see the exact number of concurrent users via Active Threads Over Time Listener available via JMeter Plugins
If you're not happy with what you're seeing and expect more concurrent users you can consider 2 options:
Increase "Loop Count" on Thread Group level as when JMeter thread has finished executing all samplers and doesn't have any more to run and no loops to iterate - it's being shut down.
Add Synchronizing Timer. It pauses all the threads until the desired amount is reached and releases them at exactly the same moment so you will be able to test i.e. what happens when 100 users are trying to log in at the same time.

Jmeter-Saturation point

How can i know the critical point where the systems breaks.
To analyze the result is the toughest part in Jmeter.I failed to judge it because everytime the result or listeners show different result
Can anyone suggest me what efforts should i put so that i can easily say "that this website is crashing with 500 users or giving no response after certain point."
I also have a problem in configuring the threads that what combination should i entered in thread group.
Because i have to report it further or needs to explain.
Reporting is JMeter's Achilles' heel. You can use JMeter Plugins project which provides
Ultimate Thread Group - which simplifies load scenario definition
Active Threads Over Time - which displays amount of active threads as your test goes
Server Hits Per Second - which provides information how many requests per second your threads provided
You can also consider using Taurus tool which simplifies the process of configuring and executing of JMeter tests and has rich reporting capabilities.

Resources