Today i got issue Non Http Response code when run script on Jmeter. My script run over some steps (Login - view) but got this issue and have log that issue at NoHttpResponseException.
I'm using Jmeter version 3.3. And I think that maybe this issue from server side, not by my script.
Does anyone fix this issue before? Please support me to resolve it.
This status code is being returned when an Exception occurs during HTTP Request sampler execution. There are hundreds or thousands of possible exceptions and even more potential causes for them.
If it occurs only under the load - most probably it's a server side error and you need to check the application under test logs and monitoring software results to identify the cause
It might be something described in the Connection Reset since JMeter 2.10 ?
It might be the case your JMeter script is badly designed/implemented and you're sending garbage instead of proper HTTP request
So try to collect as much information as you can:
Application under test and JMeter logs (it includes any middleware such as reverse proxies, load balancers, databases, etc.)
Application under test and JMeter machines health metrics (CPU, RAM, Network, Disk, Swap)
Network layer information, i.e. HTTP Request and response details.
Also be aware that according to JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.0 (or whatever is the current latest JMeter version available at Downloads page) as soon as it will be possible.
Related
I am using jmeter to perform load testing on my dev cluster. I have used HTTP Authorization Manager and have passed baseurl, username, password etc. Now my thread group have:
Number of threads:100 ,
Ramp-up period: 1 and Loop Count:1
Now for the first 50-60 calls the authorization works as expected but later it starts failing by giving error as 403. can anyone please tell me how to fix this?
I am using jmeter 5.4.1
Is there any response data? Perhaps you are getting rate limited. I also noticed you are reading in variables from a CSV. Are you sure the data in each row is correct? If you are providing auth credentials through the CSV, an incorrect row could lead to a 403.
As a side note, JMeter 5.4.1 has a log4j vulnerability, you might want to upgrade it to the latest version.
If the problem occurs under the load I can think of 2 possible reasons:
Your application gets overloaded and cannot properly handle the requests. Check your application logs and resources usage (CPU, RAM, etc.)
JMeter gets overloaded and not being able to properly send the requests. You're violating several JMeter Best Practices in particular:
you're running JMeter in GUI mode, GUI is only for tests development and debugging, when it comes to execution you should be using command-line non-GUI mode
you're using Listeners, especially View Results Tree, they don't add any value and just consuming resources
you're not using the latest version of JMeter, current stable release is 5.4.3
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.
In continuation to working on this issue - JMeter test not stopping after duration ends in distribution mode
Using JMeter version - 5.4
I got a thread dump and figured out few threads are getting stuck on HTTP Requests.
The resolution figured out is to set timeouts for the HTTP Requests as mentioned here - Configuring response timeout in Apache JMeter
But I'm not the author of the test plan. Hence, the only way I could use is to set JMeter properties.
I've set the following in jmeter.properties (values are for local testing):
httpclient.timeout=100
hc.parameters.file=hc.parameters
os_sampler.poll_for_timeout=100
and in hc.parameters
http.socket.timeout$Integer=100
But unfortunately none of these are working.
The only timeouts working are the ones when I set them in Advanced Tab of HTTP Sampler of the test plan.
Do we have any platform recommendation to control this behavior (like some other setting or property etc.)? Or am I missing anything in the above mentioned properties?
Also, I do sometimes get this exception in response, but I highly doubt if this is related?
Non HTTP response code: java.net.BindException
Non HTTP response message: Address already in use: connect
Your steps are correct so it looks like a bug in JMeter, presumably a side-effect of this commit so you have 2 options:
Downgrade to JMeter 5.0 where this functionality is still working
Raise an issue in JMeter Bugzilla but you will need to wait until someone fixes it and then either for a nightly build or a new release containing this fix
Fix it yourself and contribute the fix to the upstream
I am currently working to create test samples for an in-house Java web site using Jmeter for performance testing.
After creating / recording some scripts and re-running them, I found that some scripts are failing (not HTTP failures, the response code was 200 so it was a successful HTTP Response, but looks like server side failures) with an error "Unexpected error occurred, Page is closed". I could not figure out exact reason even after enabling high traces for this application.
I found that this web site is using lot of AJAX Requests for every sample I have collected (or most of them) and they are all recorded with samples ending with ".js". After doing a lot of google search about this issue with Jmeter, I found that Jmeter does not run Javascripts as this is not a browser.
Fair enough, went through some more details and read many solutions that talk about using Selenium web driver to run java scripts and can be used with jmeter to tackle this issue. But none of them talks about exact implementation of webdriver for running javascripts (or Ajax scripts) and having Jmeter running HTTPS Samples.
My Question is two fold:
1) How else I could debug my Jmeter scripts to confirm these errors are caused by Ajax scripts and nothing else and if not Ajax issues, what else is causing this "page closed error"
2) and how do I run web driver for Java scripts and JMeter running http samples in the same test scripts?
Any help or pointers towards a related document is really appreciated. Currently I am completely stuck and don't have any solutions that I could find reading through manuals.
In fact you have 2 choices:
Use WebDriver Sampler to perform real browser testing (this might be very resource intensive as real browsers consume a lot of CPU and RAM)
Use JMeter to execute AJAX calls. JMeter cannot execute JavaScript, but JavaScript-driven HTTP requests can be recorded using i.e. HTTP(S) Test Script Recorder and replayed as JMeter HTTP Request samplers. You will need to apply some custom configuration in order to execute AJAX requests in parallel, check out How to Load Test AJAX/XHR Enabled Sites With JMeter article for details.
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.