Client Synchronization on JMeter - jmeter

How can I develop a test, using JMeter, where two clients can connect in a single TCP Server?
In my test I will have, two Client and One Server:
Client 1 Server Client 2
| M1 | |
T1 |--------------->| M1' |
T2 | |------------->|
T3 | | R2 |
T4 | R2' |<-------------|
T5 |<---------------| |
The Client 1, send the message M1 to the server, the server process that message and send it to the Client 2. The client 2 answer the message. I want to check the time of Response from T1 to T5.
I'm implementing my client connection using Java Request. Is there any JMeter feature to Synchronize Actions between threads?
Or should I implement my own threads inside my Java Request class?
If I implement my own Threads, this mean that I will duplicate my Threads for test. How many threads a single instance of JMeter support?

1. JMeter's threads (virtual users) are absolutely independent and know nothing about what others are doing. However you can use Inter-Thread Communication plugin to add some extra logic and implement IPC
2. I don't think you should as JMeter will not be measuring these extra threads
3. You're limited only by your hardware/software. Assuming you follow JMeter Best Practices you should be able to kick off several thousands of threads on a modern PC. In any case there is always possibility to run JMeter test in distributed mode
Just in case there are TCP Sampler and HTTP Raw Request Sampler, both are capable of firing TCP requests so it might be the case you will not have to reinvent the wheel.
If you want to start 2 different Samplers at the same time you can put them under Parallel Controller, this guy isn't a part of standard JMeter distribution, you will need to install it using JMeter Plugins Manager.

Related

Performance-Load testing for with HTTP post apis mapped to eventhubs

We have an application which has HTTP Triggers associated with Eventhubs which means it has the capability to accept multiple HTTP requests /sec => more than 1 million/sec requests. It can take request from multiple API HTTP post requests. We are looking to test this application. Jmeter open supports multiple APIs but its not scalable to have 1 million requests/sec.
Are there any tools which support the event hub testing for such a Load?
Even the fastest load testing tool can achieve ~65K RPS because of the PORT limit. You can use a commercial solution or you can build your own distributed load testing infra. Locust and JMeter have distributed load testing support. But they are the poorest ones in terms of performance. So you will need lots of machines.
What do you mean by "not scalable to have 1 million requests/sec."? JMeter can kick off as many as 2147483647 threads and whether you can have million request per second will depend mainly on your application response time (see article for more details)
Of course you need to follow JMeter Best Practices.
If you don't have a machine which is powerful enough to generate 1 million requests per second be aware that you can run JMeter in distributed mode so the load would come from several machines.

Jmeter5.2.1 : Test Runs are taking more time in Jmeter

I am working on migration of scripts from performance center to Jmeter5.2.1.
As part of this migration , we are using same functional flow which we did in performance center.
My scenario consists of users logging in to the web application perform 10-15 iterations and then logout.
This is my Testplan.
TestPlan
--ThreadGroup1
--Once Only Controller (login of users)
--Loop Controller (10 Iterations)
HTTP1
HTTP2
HTTP3
.
.
--Once only Controller (logout of users)
--csv Config data ( username/password)
--csv config data( unique data for the loop controller)
With this approach I am noticing that the time taken to complete the test in Jmeter is much more than what we have in performance center ( I took care of think times and added the similar values)
Why is my test run slow in Jmeter?
Is loop controller sequential? Meaning at a given time it can run only one request?
If not loop controller what other options we have to satisfy my scenario.
If I include different thread groups , carrying JSESSIONIDs needs to be done across thread groups which is not a best practice to do so.
Update:
Comparison between performance center and Jmeter settings
Below are the settings in Jmeter.
Thread Group settings:
TestPlan :
HTTP Cookie manager in Thread Group
CSV data files in Test plan
Once Only counters for Login and Logout
Loop Controller for Iterations.
HTTP request Defaults: ( Even with out checking retrieve all embedded and parallel downloads its taking more than an hour for 3 users)
TestPlan
Performance Center results :
Every Sampler has HTTP Header manager
Entire Test Plan
Given you send the same requests you should have the same response times, no matter which tool is being used under the hood.
It's hard to say what the differences are without seeing the full scripts from the both tools so generic advice is to use a third-party sniffer tool like Wireshark or Fiddler in order to identify the differences and configure JMeter to behave exactly like the "performance center" (whatever it is)
For example I fail to see HTTP Cache Manager and it will cause JMeter to download embedded resources (images, scripts, styles, sounds, fonts) for each and every HTTP request while real browser does it only once.
I also don't see HTTP Header Manager which might be very important, for example if you send Accept header the server will be aware that the client can understand gzipped responses which will greatly reduce network traffic.
More information: How to make JMeter behave more like a real browser

Newbie, need help in designing test plan in jmeter for concurrent API calls

We have a Rest Server talking to 128 devices. I need to send 10 API calls to each device and to all 128 devices at the same time. So the Rest server needs to handle 1280 at a time every 15 mins. I am using jmeter and can create 1280 threads to make each API call unique to go to all 128 devices manually. Is there a better way to do it other than manually typing and populating the threads?
Basically, I am looking to automate the process of creating the threads through a script and load the jmx to GUI, or better/faster way using GUI itself
Normally the following test elements are being used:
Recording: using HTTP(S) Test Script Recorder for automation of the HTTP Request samplers creation. The idea is that you execute your test scenario on mobile device and JMeter captures the traffic and creates the relevant requests.
Parameterization: if your want to use different data for different virtual users you can configure JMeter to read it from external sources (files, databases, etc.), the most commonly used test element is CSV Data Set Config
Synchronizing Timer: this guy ensures that samplers it its scope are executed at exactly the same moment. Normally JMeter executes requests as fast as it can, but it doesn't guarantee that requests will happen at exactly the same moment unless you use the Syncrhonizing Timer.

Sending concurrent http requests per sec through Jmeter

preparing test plan to send multiple http request. However, jmeter waits to send another batch of request till it gets response from first batch.
I want to send 10 concurrent requests per sec. If i run 1 mins, i should have 600 requests in the then. However, since jmeter waits to send another 10 concurrent requests till it gets response from previous 10 requests, I can't send 10 concurrent requests.
any pointer would be appreciated.
The easiest option is to go for Concurrency Thread Group which tries to maintain the defined concurrency level by kicking off new threads if current amount is not enough to conduct the required throughput. So basically you need to install Concurrency Thread Group via JMeter Plugins Manager and migrate your Sampler(s) there.
More information: Advanced Load Testing Scenarios with JMeter Part 4 - Stepping Thread Group and Concurrency Thread Group

How to run multiple request sequentially in Apache Jmeter

I have an Application where i have to do load test.Its like i have request A and B,and i have to test with 10 users and request should go like first request - A,B ,second request - A,B with ramp up period 0.
Could Any one help on this.I tried doing with Simple controller but the request are sent randomly and fring error
Check the box for "Run Thread Groups Consecutively" in your test plan. It will send your request A and B for first users then for second users and so on.
See this:
If you really need to wait until 1st user is done before starting 2nd one the fastest and the easiest solution would be setting Number of Threads to 1 and loop requests A and B 10 times in your Thread Group configuration.
If for any reason you need to have 10 concurrent users but executing requests sequentially you can go for Inter-Thread Communication JMeter Plugin which allows synchronizing JMeter threads (even residing in different Thread Groups)
The recommended way of installing JMeter Plugins and keeping them up-to-date is using JMeter Plugins Manager

Resources