I am doing a performance test for an API and trying to hit it 120 times within a minute. Every time I hit, the output files written to the folder is less than 120. I never get the correct number of output files. Sometimes, I get 119, 115, 117.
Out of 120 hits, 50% is passed and 50% is failure scenarios. When checked the output folder, files are missed to write from both passed and failed scenarios.
Could someone help me to understand what could be the reason?
Jmeter Version 3.1
I would suggest temporarily enabling storing request and response details. You can do it by adding the next lines to user.properties file (the file is located in JMeter's "bin" folder)
jmeter.save.saveservice.response_data=true
jmeter.save.saveservice.samplerData=true
jmeter.save.saveservice.requestHeaders=true
jmeter.save.saveservice.url=true
jmeter.save.saveservice.responseHeaders=true
Once done - restart JMeter to pick the property up
Run your test
When it's finished open .jtl results file with View Results Tree listener and inspect request and especially response details to detect any issues
If you won't find any clues add the next line to user.properties file:
log_level.jmeter.reporters.ResultSaver=DEBUG
and look for the message starting with
Error saving sample ....
Don't forget to revert back the configuration changes once you do the troubleshooting.
References:
Configuring JMeter
Apache JMeter Properties Customization Guide
Related
I am outputting results from 30 tests to a single xml file.
Currently the file includes latency, connection time, and whether it returned OK. I want the endpoint I am hitting to also be shown. My tests run in sequence and output to a single file.
It's Save URL checkbox:
You can also achieve the same by amending JMeter Results File Configuration like:
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.time=true
jmeter.save.saveservice.filename=true
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.url=true
and others set to false
Put your changes to user.properties file, JMeter restart will be required to activate the changes.
More information:
Configuring JMeter
Apache JMeter Properties Customization Guide
I am using Jmeter to code and using cmd to run the code.
My requirement is I need to stop the execution of the request when first HTTP request fails.
For ex I have 1000 threads and if it find error in 501 thread ,I need to get at 501 sample, it started for error.
I have the Thread count as shown.
set Action as Stop test on error
And ran this in cmd and result stored as .JTL file
When I viewed that .jti in Summary tree.
I see the below output
Here I see sample count is still 1000 and error% is 7.7%.
How to find out at what sample it got the error
You can inspect the details using View Results Tree listener, by default it shows last 500 sample results, in order to increase this number you need to add the next line to user.properties file:
view.results.tree.max_results=0
also with default Results Save Configuration it shows only a limited subset of metrics like response time, status code, status message, connect time, latency, etc.
In order to be able to see full request and response you can add the next lines to the aforementioned user.properties file:
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data=true
jmeter.save.saveservice.samplerData=true
jmeter.save.saveservice.requestHeaders=true
jmeter.save.saveservice.responseHeaders=true
jmeter.save.saveservice.url=true
More information:
Configuring JMeter
Apache JMeter Properties Customization Guide
We cannot say why your test doesn't stop without seeing the full configuration, log file and knowing the nature of the failing samplers
I have the following params setup on jmeter, I am running my script in a loop which is creating huge logs(jtl file), Can I log only error responses ?
You can configure JMeter to save response data only for failed samplers by adding the next lines to user.properties file:
jmeter.save.saveservice.response_data=false
jmeter.save.saveservice.response_data.on_error=true
If you want to completely disable saving any metrics for successful samplers add the next line to the same file (however you won't be able to get reliable metrics this way):
jmeter.save.saveservice.successful=false
References:
Configuring JMeter
Apache JMeter Properties Customization Guide
Is it possible to see "view results tree " sampler of jmeter in jenkins. I want to see all my request and response data of jmeter in jenkins. i am not able to find it
By default JMeter does not store the response data when it is being run in non-GUI mode, however you can override this by adding the next lines to user.properties file (located in "bin" folder of your JMeter installation)
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data=true
jmeter.save.saveservice.samplerData=true
jmeter.save.saveservice.requestHeaders=true
jmeter.save.saveservice.url=true
jmeter.save.saveservice.responseHeaders=true
But be aware that:
It changes results output format to XML so if you have any post processors which explicitly rely on CSV default format (i.e. HTML Reporting Dashboard) - they might fail
Storing request and response data causes massive RAM and Disk IO overheads so JMeter will consume way more memory hence throughput might be lower. It is recommended to use the above settings only for debugging or investigation when something definitely goes wrong and revert them back to defaults once you figure out and eliminate the root cause.
See Apache JMeter Properties Customization Guide for more information on using JMeter Properties and ways of setting and overriding them
I have a prepared a jmx file using jmeter & ran that test case on blazemeter to test load on my server. After the test is done, I can see that one of my services are failing. Though not all the time, but some times. And in the error tab on blazemeter, i can see that is is giving
Non HTTP response message: The target server failed to respond
I am not sure, that is my server failing to handle the load, or is it something else. In My settings, thread is 50. Can any one please help me that, is this because of server is failing to handle to load. Thanks in advance.
It looks like that you're facing the problem described in Connection Reset since JMeter 2.10 ? Wiki article.
If you upgraded recently to JMeter 2.10 or 2.11, you may have noticed increased errors of this type:
Socket closed
Non HTTP response code: org.apache.http.NoHttpResponseException (the target server failed to respond)
So
Change "Implementation" of your HTTP Requests to HTTPClient4
Add the next 2 lines to user.properties file (usually lives under /bin folder of your JMeter installation)
httpclient4.retrycount=1
hc.parameters.file=hc.parameters
In hc.parameters file (also lives under JMeter's /bin folder) uncomment the following line:
http.connection.stalecheck$Boolean=true
For more information on different JMeter properties and ways of setting and altering them refer to Apache JMeter Properties Customization Guide
Encountered the same issue and fixed it by unchecking the "Use KeepAlive" option for HTTP requests. Please refer to the screenshot. I guess, the root cause was related to the connection being closed and the JMeter client trying to use the same connection.
Had similar problem for jmeter 2.13 DmitriT solution got me pointed in right direction, but in my case the java or HttpClient3.1 worked, 4.0 did not.
I have done everything.
ange "Implementation" of your HTTP Requests to HTTPClient4
Add the next 2 lines to user.properties file (usually lives under /bin folder of your JMeter installation)
httpclient4.retrycount=1
hc.parameters.file=hc.parameters
In hc.parameters file (also lives under JMeter's /bin folder) uncomment the following line:
http.connection.stalecheck$Boolean=true
BUT STILL FACING THIS ISSUE in apache jmeter 5.1
In my case it was the header for the call I was doing that was causing the issue.
It was:
Content-Type:application/json;charset=UTF-8
Set it to:
Content-Type:application/json