Webservice testing using Jmeter - jmeter

I am new to JMeter and I have been tasked to do a POC where I need to load test the webserivce. I learnt the basics like adding the test plan, adding threads, adding SOAP/RPC Requestsampler and I got the response as well. But, I am not sure how to achieve the below scenario using JMeter.
I need 600 users to hit the service per request/second (this should run for 10 minutes) and the 2nd scenario is about 2000 users to hit the service at 5 request/second (again this should run for 10 minutes)
Also, would it be possible for JMeter to handle this many number of threads/users?
Any inputs would be deeply appreciated.

Given you properly configure JMeter it shouldn't be a problem to simulate 2k users, actually you may need more as if your web service response time will exceed 1 second - you won't be able to achieve 2k requests per second.
Configuring JMeter:
Run test in non-GUI mode
Disable all Listeners (if any)
Increase JVM Heap size
See 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure for detailed explanation and instructions
Simulating 600 / 2000 requests per second.
Set "Loop Count" to Forever or -1 in Thread Group
Tick "Scheduler" box and set desired duration (600 seconds)
Add Constant Throughput Timer and specify the desired throughput in requests per minute
It is recommended to use HTTP Request sampler for web services testing, you can set Content-Type and SOAPAction headers using HTTP Header Manager

Related

Load Testing of UI User scenario - Jmeter Webdriver sampler

I want to run basic load testing scenario on a mendix application.
The initial requirement is at least 10 users should be able to perform some activities like login , file upload concurrently.
I have used the webdriver sampler in Jmeter with selenium and written the JS script for the actions.
The issue is it launches 10 browser on the same machine.
Please suggest the proper way to handle this. Currently it seems that the errors which I am getting are because of I am running the test on my laptop instead of distributed setup.
Also the total script takes 60 seconds to finish for single user. What should be the ramp up time?
If not Jmeter, please suggest any other suitable tool for this scenario.
As per The WebDriver Sampler: Your Top 10 Questions Answered article
Q. How do I Allocate the WebDriver Sampler?
A. First of all, don’t use the WebDriver Sampler to create the load! You’ll need around 1 CPU core per virtual user to keep the JMeter resource consumption within an acceptable range. The WebDriver Sampler should be used in addition to HTTP Request Samplers. Here’s an example of how it should be used:
1,000 of users are simulated by HTTP Request Samplers
1 user is the WebDriver Sampler
You should use the WebDriver Sampler to evaluate a real-life user experience. It’s most commonly used to measure the load times of pages when the system is experiencing high loads. The HTTP Request doesn’t really “render” the page and it can’t execute JavaScript. That’s why the WebDriver Sampler is so valuable - JMeter isn’t a browser and it overcomes limitations posed by this fact.
So first of all I would recommend re-considering your approach and migrating to HTTP Request samplers, you might be able to execute 10 browsers but if you will need to scale your test to 100 or 1000 users you will definitely won't be able to use this "real browser" approach while HTTP Request samplers act on HTTP protocol level, given you properly configure JMeter it will be no difference for the application under test whether the requests are originating from JMeter or from the real browser and the resources footprint will be much less.
With regards to the ramp-up time: the overall idea is to increase the load gradually so you could correlate the changing number of virtual users with changing metrics like response time, throughput, etc. According to JMeter Documentation:
The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads chosen. If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. If there are 30 threads and a ramp-up period of 120 seconds, then each successive thread will be delayed by 4 seconds.
Ramp-up needs to be long enough to avoid too large a work-load at the start of a test, and short enough that the last threads start running before the first ones finish (unless one wants that to happen).
Start with Ramp-up = number of threads and adjust up or down as needed.

I want to achieve 10000 rps when thread(user number)=10000 in JMeter, how can I achieve this target?

Which controller or timer I should use for controlling rps ?
Can you please let me know?
Thanks,
You can achieve 10000 RPS with 10000 threads (virtual users) only if your application response time is 1 second
if your application response time is less than one second - you will get more RPS
if your application response time is more than one second - you will get less RPS
There are 2 main per-requisities:
Your application has to be able to respond fast enough because if it is not capable of supporting 10k requests per second - no matter what you do you won't be able to reach the target throughput as JMeter waits for the response prior to starting the next request
JMeter has to be able to send requests fast enough so make sure to follow JMeter Best Practices and it might be the case you will have to go for distributed testing mode
The easiest way of conducting X requests per second load is using Concurrency Thread Group and Throughput Shaping Timer combination, both can be installed using JMeter Plugins Manager

How to get high rps with JMeter load testing https endpoint

I'm trying to test my https endpoint with JMeter. I want to make at least 10000 requests per second, but when I set the number of threads to 10000 I get way less rps, around 500.
I've tried setting the number of threads to 1000 and 100, surprisingly I get this same number of rps. I'm using HTTP Sampler and "use Keep-Alive" is set to true. When I look in the statistics I see that when using 100 threads, it makes use of Keep-Alive and connect_time is around 100 ms, but when the number of threads is higher connect_time grows, it's like it stops reusing the connections.
I know this isn't a server issue, because I've tried testing that same endpoint with Yandex.Tank and phantom and it can easily maintain 10 000 requests per second, the problem is it can't use response data to make furhter requests, that's why I have to use JMeter for this task.
This can be done by using "Stepping thread group". It will allow you to send 10000 request per second upto specified time. Refer below image.
Stepping Thread Group
Download jar from below link.
https://jmeter-plugins.org/wiki/SteppingThreadGroup/
I hope you are trying to achieve this using one machine. Try with multiple machine or jmeter distributed mode.
https://jmeter.apache.org/usermanual/jmeter_distributed_testing_step_by_step.pdf
https://www.blazemeter.com/blog/how-to-perform-distributed-testing-in-jmeter/
https://blazemeter.com/blog/3-common-issues-when-running-jmeter-scripts-and-how-solve-them/
I am assuming that it is the issue with machine which is not able to generate that much load. Usually, i have use max 300 threads per machine but it depend on the machine config. Just check if the machine is having issue and multiple machine is able to generate more load, considering server is not having any issue.
Hope this helps.
Update:-Usually 200-500 can be handled my modern machines.
Please check the below link to have some more info:-
1.How do threads and number of iterations impact test and what is JMeter’s max. thread limit
2.https://www.blazemeter.com/blog/what%e2%80%99s-the-max-number-of-users-you-can-test-on-jmeter/ .

JMeter number of threads in a run

I am quite new to jmeter and try to do a performance test of my application. I want to generate 100 request per second scenario however my server takes 3-4 secs to respond to every request. I am running my test for 1 mins which means number of requests fired should be 60k within the time span. However jmeter actually waits for the response before it sends next request. Which is not what I am looking for.
How can I make sure that jmeter sends a new requests every second with 100 req/sec without waiting for the response so that the number of requests fired per min is 60k.
I am trying to use constant throughput timer with 60k as request per min, however that is not helping. Here is my test screenshot.
EDIT
I have done like this
And Throughput shaping timer being as
So ideally I should get number of samples as 3000?, still not getting that.
Make sure you provide enough threads (virtual users) under Thread Group, "vanilla" JMeter won't kick off any extra threads if actual throughput is less than target one you specify in the Constant Throughput Timer.
Another solution would be using Concurrency Thread Group along with the Throughput Shaping Timer. They can be tied together via feedback loop so if you use these test elements JMeter will start more threads if the current amount won't be enough to reach the desired requests per second rate.
You can install both using JMeter Plugins Manager
My suggestion is to consider using the Arrivals Thread Group. This TG will allow you to configure the desire average throughput (ATP); the TG will instantiate the required threads needed to achieve the ATP goal.

configure jmeter setting based on request per secon

i am new to Load testing and would like configure my jmeter setting for the following requirement below. My understanding is Theard are different from request per second. If so what will be values in thread group for the below requirement.
"Initial load 20 request/second, increase load with 100 request/second for each minute.
Perform load test until we see an increase in latency "
You should put something very high into Thread Group and use one of the following approaches to define your load pattern:
Constant Throughput Timer - it comes bundled with JMeter
Throughput Shaping Timer or Concurrency Thread Group- available via JMeter Plugins project
In order to automatically stop the test when latency exceeds threshold you can use AutoStop Listener, again it comes with JMeter Plugins.
In general latency is networking related metric so even if your application is slow as a snail you can have low or even zero latency so I would recommend considering response time and/or transactions per second metrics as well.

Resources