Jmeter: How can I keep 1000 or “X” users login requests session alive using JMeter? - testing

Here is my Test Scenario:
First, I am generating a load which includes only Login Requests (say for 1000 users). I am using "Ultimate Thread Group" and "Constant Throughput Timer" in my script. Constant Throughput Timer Value=120/sec is used. I want to run this test for five or ten minutes. My load would be held for 3 minutes.
During this Test(while loads are held) , I am sending another set of login requests from the different machine (say for 100 users). I want to measure the response time of this 100 users login which I've generated from the different machine.
But My Requirement is: While I'm sending 100 users login requests, My Previous 1000 users login requests session should be alive on the server. I've also checked "Use KeepAlive" in my login sampler.
So, How can I achieve this?? How can I be sure that my previous all the login requests sessions are held on the server?
Test Script:
Image 1: Screenshot for Ultimate Thread Group
Image 2: Screenshot for Constant throughput timer

You need to consider following fields of ultimate thread group -
Shutdown time for 1000 threads ( ramp down time)
Hold load for - for 1000 threads.
Initial delay for 100 threads. ( time between starting the script and first server hit)
start time for 100 threads - make sure the 100 threads get ramp up before 1000 threads get shut down. Each thread would be start after ( start time/ start thread count ) seconds from the previous thread.
you need to configure these values in such a way that the first 1000 threads don't get shut down till the all of the next 100 users are active.
Also you can use the active thread over time graph which is provided with in the ultimate thread group to see how the many threads would be active.
P.S Don't confuse the thread number with number of requests, each thread will create multiple requests for seconds in field " Hold Load for ".

Related

JMeter - Active threats over time

I am new to JMeter. I am working with it the last month. The problem that i am facing is with the graph that shows the active threats over time. What i want to achieve is a linear graph that will show that every 2 seconds a new threat is entering the application and do whatever it needs to do. My set up is as follow:
I can not add loop count to infinite as each user is executing different tasks that can be executed only once. It can not reuse the data and hit the services/tasks again with the use of the same user.
The process is:
Login
Get Requests
Post requests
If i execute my scenario i am getting the following graph:
What i need to do in order to get something like the below:
You're dealing with the Listener which means that it will plot the first data point only when first sampler reports its metrics.
If your first request takes 10 seconds you will see the first dot in the Active Threads Over Time chart at 10 seconds when 3 users are online already.
So if you want to see "smooth" arrival of virtual users you need to add a "synthetic" sampler with a couple of milliseconds response time before your other samplers (for example a Dummy Sampler will be a perfect match), this way listeners will take it as the starting point
Demo:

Jmeter : how to get large number of rps in jmeter

I'm testing a web app using jmeter for load test and I getting a hard time on how can I set properly how many threads, ramp-up and loops will I use in order to get a large number of rps. Anyway, I want to check if my server can keep up to 500rps. Does anyone here can help me how can I set it properly. Thanks.
The number of requests per unit of time is called Throughput and mainly depends on two factors:
Number of active threads
Your application response time
The first one is obvious - more threads -> more requests per second. However JMeter will wait for response from the previous thread before starting the next request so application response time matters as well.
So the recommendations are:
Set number of threads in the Thread Group to the number of anticipated users of your system.
Set ramp-up period accordingly to the number of threads so the load will increase (and decrease) gradually, this way you will be able to correlate increasing/decreasing load with the changing response time and throughput
Instead of loops it might be a better idea to set desired test duration using Scheduler section of the Thread Group.
Run your test and observe the actual throughput using i.e. Server Hits Per Second listener or Transactions per second chart of the HTML Reporting Dashboard. If it matches your expectations - you are done, if not - you will need to increase the number of virtual users.
You can use ConcurrencyThreadGroup plugin , Specifically see how to Produce Desired RPS:
Threads pool size can be calculated like RPS * <max response time> / 1000. The more rate desired the more threads you will need. The more response time service have the more threads you will need.
For example, if your service response time may be 2.5sec and target
rps is 1230, you have to have 1230 * 2500 / 1000 = 3075 threads.

Sending HTTP Request at precise time intervals with JMeter

I'm using JMeter to test an Apache2 server I configured. I'd like to test whether the server can handle 200 HTTP requests coming altogether every second, repeatedly for a high number of seconds (like 1 minute, or even more). I read the JMeter documentation, but it struggled a little bit in understanding the Timers functioning. I configured the test with
- Numbers of Threads 200
- Ramp-up period 1
- Loop Count 100
Now, as far as I understood and noticed, the behavior of JMeter is to try to raise the 200 threads in 1 second, and then perform 200*100=20000 requests as fast as possible (or at least this is the behavior I'm experiencing on my server), in chunks of 200 requests per time. This means that the server might (it actually does) receive more than 200 requests/second. The behavior I'd like to reproduce is instead to have 200 requests exactly every second. I don't care if they are coming all together at the beginning of the second, or they come in a randomized way, distributed the second window (one every 5 milliseconds, or whatever). So I tried some Timers, but without success. I tried:
Constant Timer with a Thread Delay of 5 milliseconds. Doing the math, it should send a request every 5 milliseconds, and being 200 Threads, it should send 200 requests/second (200*5 = 1000ms).
Constant Throughput Timer with a target throughput of 12000.0. Maybe I'm wrong here, but this should be samples per minute, so 200 requests per 60 seconds are 200*20 = 12000 (if a sample is a request). I did not understood the "Calculate Throughput based on" option, and I tried both "this thread only" (which one?) and "all active threads".
Anyway, none of this configuration is acting as I need.
You can achieve this by using Constant Throughput Timer.
Constant Throughput Timer can only pause the threads to reach specified "Target Throughput" value so make sure you provide enough virtual users (threads) to generate desired "requests per minute" value.
So, to get 200 requests/sec you have to consider below things:
Make sure that you have Enough number of virtual users (Threads) in your Thread Group.
Throughput Timer is quite accurate on "minute" level, you need to "wait" for it to start working as expected for 60 seconds. Make sure that you have Enough Durations.
Use the Constant Throughput Timer at the test plan level.
Use "Calculate Throughput based on" value as "All active threads".
Also, Remember that other elements (for example, other timers, the number of specified threads, and so on) within the test plan can affect attaining the desired throughput.
So, Here is a technique that you can follow:
First, use the below configurations and observe the throughput results.
Numbers of Threads : 200
Ramp-up period : 60 seconds
Loop Count : Check "Forever".
Duration (seconds) : 360
If it's not as expected (lower than expected), then increase the Number of threads gradually and observe the throughput results increased or not.
You have to increase the number of threads until you get your desired throughput.
By doing this, if you can't get your desired throughput (200 Request/sec) then your application can not serve more requests per second than 200.

How to load a single SOAP Request with multiple authentication in Jmeter

I am very new to Jmeter and need to perform a load testing of one SOAP request with 100 Authentication data. I tried the below approach, where I saved the authentication data in CSV file, using CSV Data Config parameterised and passed onto HTTP Authorisation Manager. I am able to sequentially test the SOAP request with all the user authentication data available in CSV, but I need to run concurrently, with all the 100 users. Thanks in advance.
I have 5 users authentication(username/password) in csv file
Set your Number of Threads to 100, and the Loop Count to 1.
Number of Threads has to do with the number of concurrent users that get run.
Loop Count has to do with how many times a user actually does your script.
Note that if your ramp-up is slower than your script time, some users will finish before your test reaches its full concurrency. Check this question for use with the scheduler.
In order to make all the requests to fire at the same time you need to add Synchronizing Timer to your test plan.
Increase "Number of Threads" to 100 on Thread Group level
Add Synchronizing Timer as a child of the SOAP/XML-RPC Request
Set "Number of Simultaneous Users to Group by" to 100
Make sure that CSV Data Set Config has following configuration:
"Recycle on EOF?" - true
"Stop thread on EOF?" - false
Thanks everyone for the quick answer. With the synchronizing timer had to modify "Sharing mode" option to "Current Thread Group" in http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config.

Long polling Windows Phone, 60 seconds TimeOut

HelloA Windows Phone application need to connect to a server and get messages from it. This is done using WCF and long polling on the server. 3 minutes is the timeout defined on the server. Call from windows phone is done using HttpWebRequest.
The problem is that Windows Phone devices have a timeout of 60 seconds for get request (emulator have a different value, greater than 3 minutes).
Currently i can't decrease server timeout. Doing a new GetRequest after the 60 seconds doesn't get anymore messages.
Does anyone have an idea ?
Thanks
I don't think leaving a connection open is a good idea on mobile devices. I'm assuming that's what you're doing. In my app, I would just poll whenever needed by creating a new HttpWebRequest. But it made sense to do this in my app, because I would be updating train arrival status every 40 seconds.
If you're trying to pull data on a given schedule, put a timer in and just call the webserver every 3 minutes or whatever the requirement is.
If you want to be able to check things (when the app is closed) or if there's rarely fresh data on the server, then you'd need to implement a Push mechanism.
Update: Here's a good article on dealing with the timeout issue - http://blog.xyzzer.me/2011/03/10/real-time-client-server-communication-on-windows-phone-with-long-polling/
Update 2: What if you arranged it so that, you have cascading connections - what I mean is since you can't go beyond 60 seconds per connection, you can write a class that'll house two connections and once one of them is about to timeout, say several seconds before, you can start opening the other connection - you can pick the timing so that there's at most 5 seconds of overlap between them. This way you could have your always open connection.
Also see what these guys have done with the GChat app, they have their source code available at this link. This may provide a more proper design.