Testing response time - jmeter

I am trying to make a request where it returns very big data. When I make a request from Katalon Studio or JMeter, it gives me a response after 7-8 seconds. But from swagger when I try to make same request as I did from katalon studio it needs 2-3 minutes to give me the data and also if it needs more than 2-3 minutes, page dies.
Can you help me understanding, why I get response from swagger so slow and from Katalon so fast? I think the problem is in showing the big information ?
In JMeter data is not shown fully.
I can provide everything what is needed.
This is the data from JMeter.

With regards to "swagger so slow" - most probably it's your browser issue, it might fail to render big amounts of data. Consider using a command-line tool like Curl which can output the response as plain text or save it into a file
With regards to JMeter data is not shown fully, by default JMeter limits the data coming from the server to save memory to 10 megabytes, it's controllable via the view.results.tree.max_size property. If you want to see the full response data in the View Results Tree listener - add the next line to user.properties file:
view.results.tree.max_size=0
or provide the above parameter via -J command-line argument like:
jmeter -Jview.results.tree.max_size=0 -t test.jmx ....
see Apache JMeter Properties Customization Guide for more information on JMeter properties and ways of setting/overriding them.
You can also consider using Save Responses to a file listener to store the response to a file of your choice.

Related

JMeter: Does the **Save Responses to a File** storing the data in the cache first when the request is not yet done?

I'm currently testing a 1.5GB download. Does the Save Responses to a File storing the data in the cache first when the request is not yet done? Is it possible to configure the JMeter to write the file while receiving the data?
As of JMeter 5.4.3 the Save Responses to a File listener:
Waits for the full response to arrive to JMeter
Writes it using BufferedOutpuStream via JOrphanUtils.write() function
It's not possible to easily amend this behaviour unless you're willing to write a custom plugin for JMeter
I can suggest a better option: instead of saving the whole file you could:
Tick Save response as MD5 hash? box under "Advanced" tab of the HTTP Request sampler
The downloaded file integrity can be checked using MD5Hex Assertion
The point is that same files have the same MD5 checksum, if the downloaded file's checksum will be different - it means that the file content differs and MD5Hex Assertion will fail the associated Sampler.
As a bonus, this trick will greatly reduce JMeter's memory consumption and you will be able to conduct higher load from the same machine.
More information on JMeter Assertions concept: How to Use JMeter Assertions in Three Easy Steps

JMeter - returns 401 unauthorized for few test

I am using jmeter to load test a website. I have tested from 1 to 400 users. however while testing for above 500 users/threads, I am getting 401/unauthorized error for few users. Hope you'll help me to find out a solution to this problem.
I can think of 3 possible reasons:
There is a parameterization problem with your test, i.e. it sends wrong credentials, you can use i.e. Simple Data Writer configured to save requests and response data for failing requests and inspect it using View Results Tree listener.
JMeter gets overloaded and cannot properly perform correlation. In addition to point 1 check whether you're following JMeter Best Practices and ensure that JMeter has enough headroom to operate in terms of CPU, RAM, etc. using i.e. JMeter PerfMon Plugin
Your application gets overloaded and cannot handle 500+ users, check your application logs, resources usage, output of APM tools, etc.

Jmeter & browser concurrent requests showing different results?

When I have given 500 concurrent users load via jmeter my server throwing error message but the same time I have called same request via browser showing proper response. How it is possible? Is there any settings in jmeter for avoiding same.
It is hard to say what can go wrong without seeing your JMeter configuration, full server response, JMeter and application under test logs and network dump for browser and JMeter.
The whole idea of performance testing is mimicking real user as close as possible, so you need at least
Add HTTP Request Defaults and set JMeter to:
Download embedded resources
Use concurrent pool of 2-5 threads
Add HTTP Cookie Manager
Add HTTP Cache Manager
Add HTTP Header Manager
Correlate any dynamic parameters
Simulate any specific application behaviour (i.e. AJAX calls)
etc.
In addition to above recommendations: ideally given "good" JMeter you shouldn't see any "response messages", you should see a number of errors in final report so double check you:
Run JMeter in non-GUI mode
Storing only those metrics which are absolutely required
Follow other recommendations from 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure
beside, what Dmitri described above, I would also check the actual throughput the server returns in either cases.
Throughput depends a lot on the timers you configured in Jmeter to simulate think time.
Jmeter has no rendering and no javascript engine, so each thread is much much faster than a real browser.

JMeter response time is high

I have a test plan written using JMeter & in that I have used Regular expression extractor to extract some value and pass it ON to other request in the test plan. I also used the CSV file to pick the value from sheet & used in my test plan.
Now the problem is that while running the script using JMeter, I am getting the high response time. When the JMeter is running the script, I tried to check the same site response manually & in that I was getting a very less response time.
I disabled the listeners & started the script in Non GUI mode but still the response time is on high side.
I need to justify the response time received from the JMeter to the client. Could someone please let me know what am I doing wrong ?
Thanks
I used the HTTP Cache Manager with Use Cache-Control/Expires header option which reduces the JMeter response time & nearly in sync with browser timing.

How to log full http header with jmeter

I'm setting up a Jmeter performance test case and in the debugging phase I need to log the full HTTP headers.
I have created my jmx script for a test.
I can't find anywhere how to tell Jmeter to log that to the ouput in jmeter/log.
Is it possible and how ?
In the JMeter workflow, it is usually the easiest to use the GUI to create and debug your test. The View Results Tree listener shows a tree of all your requests and responses, including header information. It should be mentioned, even though it is called out in a red box at that link, do NOT use the view results tree listener during a load test, it is a very expensive component that drains memory and CPU.
To debug from the command line, the save responses to a file listener is the usual go-to to save response data to disk, but I'm not certain it saves headers. The Simple Data Writer listener though does both Request and Response Headers via the configure panel.
Again, care should be taken to not leave in excessive logging for a full load test, your disk I/O could become a bottleneck.
And last, as with most things JMeter, you can replicate any behavior in a beanshell component. Either a post processor or an assertion.
if (someCondition) {
log.info(ResponseHeaders);
}

Resources