Is it possible to use Jmeter for a test where it can work as both HTTP server and client?
To be specific, can it answer to GET request received with 200 Ok (+ Payload) and also send POST messages (+Payload) at a specific rate?
It looks like you're looking for the HTTP Mirror Server
Otherwise if you want to test your workload distribution or throughput you can consider using Dummy Sampler instead of HTTP Request samplers.
For the "specific rate" - see Constant Throughput Timer
Related
The websocket in Postman is immediately connected below, producing a room and a socket.
wss:/service.com/?token=POTE117771
However, the outcome of the websocket added plugins in JMeter is 0"sid":"UME84d0DoF9N3tDCAABQ","upgrades":[],"pingInterval":25000,"pingTimeout":20000,"maxPayload":1000000.
However, no rooms or scokets are made.
It should be connected for jmeter to send requests. kindly assist me
We are not telepathic enough to "assist" you without seeing your Postman and JMeter configuration, which exact plugin you're using:
JMeter-WebSocketSampler by Maciej Zaleski
or JMeter WebSocket Samplers by Peter Doornbosch
But one thing is obvious: if you send the same request (or in case of WebSockets it might be a sequence of requests) you will get the same response so make sure that JMeter is sending the same request as Postman does (apart from dynamic parts which need to be correlated) the request from JMeter will "produce room and socket" (whatever it is)
We have a REST API. When we call the API through the jmeter we get high response times compared to calling the API directly with a c# client that makes a Http request.
There are no resources or anything. It is a POST call that returns around 1 MB of data. With jmeter the latency is around 300 ms vs calling the API directly the latency is 100 ms.
Why is this difference ? What settings should we tweak in jmeter ? Tried tweaking the SSL settings. But that did not make any difference.
Any suggestions ?
THanks
We cannot say anything meaningful without seeing the C# code and your JMeter configuration.
Given you're sending the same requests you should be getting the same responses in more or less the same time so use an external sniffer tool like Wireshark to capture the requests from C# http request and JMeter and compare them. Amend JMeter's HTTP Request sampler configuration to 100% match the C# http request including Headers
Also if your C# http request supports proxy (it should theoretically) you can just record the request using JMeter's HTTP(S) Test Script Recorder, this way you will get the same configuration of the HTTP Request sampler and HTTP Header Manager.
With regards to "tweaking" JMeter I can only think of JMeter Best Practices.
I am initiating the request from Jmeter using HTTP Request Sampler. In the body data i am sending the request and the application server sends back two different responses for the same request. After receiving the first response, Jmeter will close the request and in my scenario i need to capture the second response also. Kindy share your ideas on this.
Regards,
Chandru
Which protocol? In case of HTTP this is exactly how it supposed to work: one request -> one response, you can keep the underlying TCP connection alive so JMeter would re-use the connection for sending the next request, but HTTP Request sampler won't expect any additional responses.
In case of Server Side Events you will need to do some scripting in order to handle the situation like it's described in How to Load Test SSE Services with JMeter article
In case of WebSockets take a look at Read continuation frames.jmx example test plan
There is an http request that the server is not responding it with an "http or http/json response".
The server sends some tcp messages like [ACK] and [PSH,ACK].
But JMeter waits for an http response, because the request is http request sampler.
Is there a proper way that i can continue as if the response of this request is received correctly?
I am I correct in saying you're more looking for a TCP sampler rather than a HTTP sample?
TCP ACK is not response which you want I guess. It's just transport layer acknowledge. According to HTTP protocol there should be response for every request, I mean HTTP response. So your server doesn't work correctly and jMeter shows it.
Just compare the requests which JMeter sends with the requests the real browser sends, configure JMeter to behave exactly like the real browser and that would be it.
If you want a comprehensive answer you need to show:
Full HTTP Request details in Wireshark (like Follow HTTP Stream) from the real browser
The same for JMeter
Your HTTP Request sampler configuration (including any configuration elements involved like HTTP Header Manager)
Blind shot: can it be the case that your HTTP Request sampler invokes switching protocols and later communication happens using WebSockets?
If yes - double check that you're sending proper headers like:
Connection: Upgrade
Upgrade: websocket
and once done continue simulating the traffic using WebSocket Samplers
i send 10 requests to the server which was recorded by blazemeter chrome plugin.
some of them are signalr requests that have connection token values created runtime.
signalr requests are
signalr/negotiate?..
signalr/connect?
signalr/start?
signalr/abort?
if i dont use regular expression extractor for correlation, the signalr request has wrong responses and test will fail.
if i use correlation, some interesting results are present.
if i use it only in signalr/start it will pass, the other signalr's will fail.
if i add the connectionParameter to the signalr/connect... request. it will do nothing and test will not continue and not finished. So, i wonder if Jmeter dont send the request or any response is received. in view result tree listener, the request is not seen in this case.
What will Jmeter do if a response is not send by server?
or any other information that i dont know related to signalr/connect.. issue?
What will Jmeter do if a response is not send by server
When it comes to HTTP Request samplers JMeter will wait for response for the time defined in the "Timeouts" section of the aforementioned HTTP Request sampler
Blank values mean "no timeout" so JMeter will wait either forever or until the socket timeout defined in the underlying JVM or OS is exceeded.
With regards to SignalR most probably you need to use WebSocket Samplers plugin, I don't think there is a way to record these requests using whatever JMeter recording solution currently available in the market so consider inspecting the traffic from your browser to the backend using either browser developer tools or a 3rd-party sniffer tool like Wireshark.