2

I have a very simple Jmeter test plan with a thread group and supported by basic config elements. My HTTP Request Sampler just points to the home page of the application which gives facility for login authentication.

Few facts to share

  1. When I access the page in chrome and view the loading time in chrome developer, the same is completed in 5 seconds with embedded resources downloaded in parallel.

  2. When I record the same through jmeter and start re-play it takes 12 seconds

  3. Next I disabled all the non-html resources and marked the home page to download embedded resources.

  4. When I enable the checkbox Download all embedded resources with parallel download check box and the value set at 6, jmeter goes to a hang state.

  5. I thought that might be the issue with Jmeter setting, then i tried www.w3schools.com site, and I was able to refer on the home page and during replay all the embedded resources were downloaded.

Please help me to understand if the page i am trying to script has any security involved, where we cannot download parallel resources through script or what can be the possible correction.

The application is accessible through https protocol.

Heap Dump

"Image Fetcher 0" Id=5734 TIMED_WAITING on java.util.Vector@567840bf
    at java.lang.Object.wait(Native Method)
    -  waiting on java.util.Vector@567840bf
    at sun.awt.image.ImageFetcher.nextImage(Unknown Source)
    at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
    at sun.awt.image.ImageFetcher.run(Unknown Source)

"ResDownload-Thread-5659" Id=5709 TIMED_WAITING on java.util.concurrent.SynchronousQueue$TransferStack@c26b878
    at sun.misc.Unsafe.park(Native Method)
    -  waiting on java.util.concurrent.SynchronousQueue$TransferStack@c26b878
    at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
    at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
    at java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown Source)
    at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    ...

"ResDownload-Thread-5521" Id=5704 TIMED_WAITING on java.util.concurrent.SynchronousQueue$TransferStack@c26b878
    at sun.misc.Unsafe.park(Native Method)
    -  waiting on java.util.concurrent.SynchronousQueue$TransferStack@c26b878
    at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
    at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
    at java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown Source)
    at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    ...

"ResDownload-Thread-5545" Id=5703 TIMED_WAITING on java.util.concurrent.SynchronousQueue$TransferStack@c26b878
    at sun.misc.Unsafe.park(Native Method)
    -  waiting on java.util.concurrent.SynchronousQueue$TransferStack@c26b878
    at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
    at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
    at java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown Source)
    at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    ...

"ResDownload-Thread-5555" Id=5702 TIMED_WAITING on java.util.concurrent.SynchronousQueue$TransferStack@c26b878
    at sun.misc.Unsafe.park(Native Method)
    -  waiting on java.util.concurrent.SynchronousQueue$TransferStack@c26b878
    at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
    at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
    at java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown Source)
    at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
Shantanu Sen
  • 221
  • 3
  • 4
  • 18

2 Answers2

1
  1. Make sure to tick Disable cache box in the browser developer tools:

    enter image description here

    as it might be the case your browser is not making the actual requests and returning the embedded resources from disk or memory cache

  2. Add HTTP Cache Manager to your test plan in order to mimic the browser cache.
  3. JMeter might fail to recognise certain resources like images embedded in CSS files so it might be the case you're suffering from a JMeter bug. So you can consider using i.e. Parallel Controller as the workaround for edge cases.
Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • I implemented step 1 and 2 but Jmeter hangs with 100% CPU and 90% Memory. I am left with only 3 choice which was plan B for me. I have already uploaded the heap dump snapshot for further troubleshooting. – Shantanu Sen Jan 28 '19 at 03:28
  • I implemented Step 3 and it is simulating the time of the browser. Although it is resolving my issue, but the reason of Download all embedded resource failure is still a mystery. – Shantanu Sen Jan 28 '19 at 03:44
  • I am closing the issue with the resolution mentioned in #3 – Shantanu Sen Jan 28 '19 at 04:42
0

If you're doing your test from enterprise and thus have a enterprise proxy, maybe the website you're hitting requires some rules to allow all resources to be downloaded, so you may need to adjust command line options:

Also, be aware that you should not be load testing third-party websites (Google Analytics , trackers ...) that your application may be using, so use the exclude pattern to ignore this.

You say that JMeter hangs, to debug, use Help > Create a Thread Dump and show content of output file in your question.

My guess is that it's trying to establish connection , since it has no access it hangs, so you ca set in Advanced tab of HTTP Request:

  • Connect timeout
  • Response timeout

Timeouts configuration

UBIK LOAD PACK
  • 33,980
  • 5
  • 71
  • 116