JMeter HTTP Request Slow Response - jmeter

I am using JMeter to perform load testing on HTTPS site. I created script using Blazemeter Script Recorder Manually, I am able to launch and login to website very efficiently. when I play script HTTP Request is working very slow. It take long time to initiate and complete each request as shown below in image.
1st Request:
Second Request:
I have created only one thread as mentioned below in the image
I will be thankful to you for your help in this regard as i am facing too much delay in each Http Request
Thanks

I don't think we can efficiently troubleshoot your network issues by looking into these 2 screenshots, I can only state that well-behaved JMeter script produces almost the same response times as the real browser does (actually a little bit less because JMeter doesn't really render the response)
If you want to have the "real" time from your browser either use a "clean" session by removing all browsing history, especially cache or disable the caching in your browser developer tools and compare with the load time metric:
What I can tell by looking at your screenshots is that you have very high Connect Time values:
For first request it takes 1 second out of 2.6 seconds to establish the connection
For second request it takes 900 milliseconds out of 1200 milliseconds to establish the connection
So if you are in Australia and trying to test a server which is located in northern Canada - the only solution would be moving JMeter geographically closer, otherwise contact your network administrator/ISP/etc. and ask them, not us.
You can get debugging information on Java network stack by adding the next line to system.properties file (lives in "bin" folder of your JMeter installation)
javax.net.debug=all

Related

jmeter proxy recording duplicate request

I am currently using JMeter to record a test scenario with the HTTP test recorder proxy.
Problem is, when I send a request with IE on my application, the recording controller gets flooded with an unlimited number of duplicate requests corresponding to the one I just sent.
Multiple requests when accessing default page
Any idea about why this could be happening is welcome.
Have a good day
JMeter's HTTP(S) Test Script Recorder should be accurate enough and if you see extra requests most likely they happen.
I would recommend double checking what's going on on network level between IE and application under test Using Windows Internet Explorer Developer Tools Network Capture.
If it reproduces in IE without JMeter proxy - it might be an integral part of your application, i.e. it does periodic polling for updates using AJAX calls which needs to be reflected in your load test as well.
If not - you need to find the reason why does JMeter behave this way starting from enabling debug logging for JMeter proxy. It can be done by adding the next line to log4j2.xml file (lives in "bin" folder of your JMeter installation)
<Logger name="org.apache.jmeter.protocol.http.proxy" level="debug" />
So after hours of setting comparison and http request analysis, I found out it was just the "type" parameter of the HTTP Test Script Recorder that needed to be set to "Java".
Hope this can help someone.
Don't forget to have a good day :-)

JMeter Load Testing Time Verification

I use JMeter for checking load testing.
I note a time with stopwatch when i check load time personally it was
8.5 seconds
when i run same case with JMeter it gave load time of 2 seconds
There is huge difference between them, How can i verify the actual time?
e.g : if one user taking 9 seconds to load the form while in JMeter it is given load time 2 seconds
Client time is a complex item, as you can see from the clip from the Chrome Developer tools, performance tab, above. There's lots going on at the client which does lead to a difference between the time you see with an HTTP protocol test tool, such as JMETER (and most of the other performance test tools on the planet) and the actual client render.
You can address this Delta in a number of ways:
Run a single GUI Virtual user. Name your timing records such as "Login" and "login_GUI." The delta between the two is your client weight. Make sure to run the GUI virtual user on a dedicated host to avoid resource contention
Run a test with all browsers. This was state of the art in 1995. Because of the resource cost and the skew imposed on trying to figure out the cost of the server response the entire industry shifted to protocol level virtual users. Some are trying to bring back this model as "state of the art." It is not
Ask a performance question earlier, also known as "shift left..." Every developer has these developer tools at their disposal, as does every functional tester. If you find that a client is slow for one user, be curious and use the developer tools to identify, "why?" If you are waiting to multi user performance testing to answer questions related to client weight, then you have waited too long and often will not have the time or resources to change the page architecture in meaningful ways to reduce the client page cost. This is where understanding earlier has tremendous advantages for making changes.
I picked the graphic above deliberately to illustrate the precise challenge you have. Notice, the loading of the components takes less than a tenth of a second. These are the requests that JMETER would be making. But the page takes almost five seconds to "render." Jmeter is not broken, it is working as designed. It is your understanding that needs to change on which tools can be used to pull particular stats for analysis.
You can't compare JMeter load time to browser as is, also because your browser will load JavaScript files and can call JavaScript functions on page load while JMeter doesn't execute JavaScript.
JMeter is not a browser, it works at protocol level. As far as
web-services and remote services are concerned, JMeter looks like a
browser (or rather, multiple browsers); however JMeter does not
perform all the actions supported by browsers. In particular, JMeter
does not execute the Javascript found in HTML pages. Nor does it
render the HTML pages as a browser does (it's possible to view the
response as HTML etc., but the timings are not included in any
samples, and only one sample in one thread is ever displayed at a
time).
Just a side note - you can use plugin to check exact load time in chrome.
Well-behaved JMeter test timing should be equal or similar to real user timing, if there is a 4x times difference - most probably your JMeter configuration is not correct.
Probably the most important. Make sure your HTTP Request samplers are configured to retrieve so called "embedded resources" (images, scripts, styles) which are referenced in the web page
If your application is using AJAX technology make sure you execute AJAX-driven requests as well and add their elapsed time to main sampler using i.e. Transaction Controller.
Make sure you mimic browser's:
Cookies via HTTP Cookie Manager
Headers via HTTP Header Manager
Cache via HTTP Cache Manager
Assuming all above you should be receiving similar to real user experience page load time. See How to make JMeter behave more like a real browser article for more detailed information on the above tips.
In addition to the answers provided by James and user7294900, please find these images to help you understand the reason behind the difference in time given by your stop watch and JMeter.
Below image gives the ideology behind how JMeter provides the time.
Below image gives the ideology behind how you have measured the time with
your stop watch.
Notice that there are additional actions performed by the browser when you are taking the time using your stop watch. This is the reason behind the huge difference in time between JMeter and your stop watch.
In addition to this, ensure that you are using the same test environmental conditions for both the tests (like same network conditions, same LG etc.)
Hope this helps!

There is Jmeter response time difference between Jmeter run results and manually captured the response time

There is Jmeter response time difference between Jmeter run results and manually captured the response time from the local system using stop watch on the web application.
Browse the web app from local windows system and use stop watch to see the response time to load the page.
Run the Jmeter in non-gui/gui mode and observe the response time (used Listeners only to debug, when run the script no listener was added)
Can see there is a difference in both. Please suggest how to know if Jmeter has captured the correct response time.
Given you properly configure JMeter you should get the same or similar response time for the same request. "Proper" configuration stands for:
You should configure JMeter to retrieve embedded resources and use parallel thread pool of ~5 threads for this
This options "tells" JMeter to fetch images, styles and scripts referenced in the main HTML page and do it in parallel like real browsers do
Add HTTP Cache Manager to your Test Plan. Real browsers download embedded resources but do it only once, on subsequent requests the resources are being returned from disk cache, no actual request is being made. HTTP Cache Manager enables cache simulation and cache-control headers handling.
Add HTTP Cookie Manager to represent cookies/sessions and deal with cookie-based authentication
Add HTTP Header Manager to your test plan to represent browser headers. It might be important as i.e. missing Accept-Encoding header may disable server-side compression therefore client will receive much more data and it will take more time.
Assuming "good" JMeter configuration you should see more or less same behavior
If there are still differences - capture the requests sent by JMeter and the browser using a sniffer tool like Wireshark and amend JMeter configuration to eliminate the differences
JMeter have three basic measurements it captures per request:
Elapsed Time (which is overall timespan from the point when it just starts sending request to the last bit received)
Latency (which starts the same point in time and ends when server starts responding)
And Connect time (which is included in latency and is basically the time for handshakes with server, including SSL/TLS negotiations)
So if you set a data writer among your listeners (e.g SimpleDataWriter, although AggregateReport & SummaryReport can do it as well), you'll see these metrics in your data file (while standard listeners/visualisers/aggregators stuck to elapsed time only).
But mind that these metrics doesn't include response rendering, and especially any code to be executed by browser.
JMeter just doesn't do it at all: obviously, it measures just the combined performance of Server + Network, skipping everything on the client side (except for bare necessities, like protocol negotiations).
That might explain the difference you've experienced.
As well as the difference between logged server processing times & the response times measured by JMeter: server just doesn't count what the network brings in.
PS And you don't have to sit and click on stopwatch with your browser: modern ones have a Dev Tools capable of showing you the precision timings divided by stages. E.g., just call Ctrl+Shift+I in Chrome, switch to network tab & behold the timings right there as you doing your requests.

Sample time (ms) is different from the response time of Loadrunner for the same request. Why is it so?

We recorded a request for launching a website page in Jmeter excluding all the static content files css, js etc. When we replayed the script, the Sample time( considering that it is the response time) was coming around 5000ms.
We recorded the same request in LoadRunner and the response time was coming around 300ms. Also when we saw the response time for the request through HTTPFox it was also around 300ms.
My question is why there is a drastic difference between the response time measured by the two tools. Am i going wrong while calculating the response time in jmeter OR is there any other way to calculate response time in Jmeter?
I can see several reasons on why this can happen:
JMeter is configured to "Redirect automatically" or to "Follow Redirects"
JMeter is configured to "Download embedded resources"
Your system under test demonstrates high Latency (amount of time for the request to reach the server, JMeter reports overall response time as latency + actual response time, see The Load Reports guide for metrics explanation)
There are lots of architectural differences which can contribute to this difference between the tools. Narrow your scope to one request, such as an image, and scale up your number of users in both tools to see what happens.
You also have test configuration items that can come into play, such as JMETER running monolithic on one host vs loadrunner running distributed amonst many generators. Think time setting differences, number of users. etc... You could spend all day nailing the jello of test settings and architecture.
But, given that the Loadrunner time is closest to observable with a proxy and manual execution what can you infer about the rest of your test data?

Why JMeter reponse time is more important than response time in browser

I read some related post concerning the same problem but i did have concerns.
In fact,jmeter reponse time is the time maked by the server to send and analyse reponse and the browser page load time is client side. Added to that JMeter send request in sequence and the browser send many at the same time it depends from browser to another. Even that requests are sending in the same time normally the response time will be very close for the two case. I'm attending to find response time for manual tests with browser more important than JMeter but unfortuanately there is a huge diffrence (even 3 minutes) that make me wonder the cause.
I think because of following reasons,
JMeter is server side load testing tool (means we are worried about server response and not about client i.e. browser)
When we see resonse in browser, sequence is, raw text response is parsed first, css applied, any other styling features are applied, JS if any starts running and then you see a complete web page loaded but all this is client activity and not server
When we are interested in, why response from server is slow? or what is the server response at specific load? then we use jmeter which will give time from request sent to server till we get first byte of response which is server response time + latency
Thus Jmeter response time is less than browser and is more important in server side load testing
But there are plugins available which will help you simulate sending parallel requests and ajax requests to server, by default Jmeter sends requests sequentially but plugins and tweaks are available for your need.
I hope this clarified your doubt. :)

Resources