1
votes

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

4
what are you comparing exactly load time of browser? against time in jmeter result?user7294900
Google Chrome browserSaad Saghir
Have your developers and functional testers leverage the developer tools inside of the browser for individual timings as well as weight of the client side components. This is the optimal measurement. If it will not scale or perform for one, then it will not perform for many. If you do not understand the performance envelope for one, then you are too early to ask a question on the performance envelope for manyJames Pulley
See performance tab under Chrome developer toolsJames Pulley
@JamesPulley My Question is How can i check Load Testing on my Website with Number of Records & Users using JMeter and how can i believe on JMeter time Because it's totally differ from the actual TimeSaad Saghir

4 Answers

1
votes

Chrome Developer tools, Performance Tab

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.

1
votes

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.

0
votes

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.

  1. 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

    JMeter Embedded Resources

  2. 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.
  3. Make sure you mimic browser's:

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.

0
votes

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.

enter image description here

Below image gives the ideology behind how you have measured the time with your stop watch.

enter image description here

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!