Blazemeter / jmeter-http2-plugin

HTTP2 plugin for Apache JMeter
Apache License 2.0
45 stars 27 forks source link

Retrieve all embedded resources parallel downloads handling for http2 #40

Closed serputko closed 8 months ago

serputko commented 1 year ago

Hello all, current http2 Retrieve all embedded resources implementation works similar to regular HttpRequest implementation and might be confusing for end users. It also requires a lot of time to figure out how plugin works under the hood to make it working as expected.

Here what I mean: let's imagine simple case with simple html page and bunch of static resources in it, everything works on http2. As a user I create http2 sampler, configure it and enable "Retreive all embedded resources" and "Parallel downloads=6" as looks the same as for regular Http sampler.

From the first sight it works, but actually jmeter creates 7 tcp connections to server instead of 1 as per http2 spec. It also creates ([http.JettyClient.minThreads ... http.JettyClient.maxThreads] x 6) amount of threads to download static data. telegram-cloud-photo-size-2-5366512979123751973-w telegram-cloud-photo-size-2-5366512979123751974-w

image

Requests are sent in different connections(not expected):

image image

That looks like an overhead from Jmeter perspective as well as it's not similar to how browser and other clients handle this. To make it realistic you should tick "Retreive all embedded resources" but do NOT tick "Parallel dowloads". In this case jmeter will create 1 tcp connection(as expected) and load resources in N threads you specify in jmeter properties [http.JettyClient.minThreads, http.JettyClient.maxThreads] telegram-cloud-photo-size-2-5366512979123751971-w telegram-cloud-photo-size-2-5366512979123751972-w Requests are also sent in single connection as expected:

image image

Let's document this behavior or warn users about this somehow in UI or remove that parallel download feature at all for http2 calls.

Thanks :)

serputko commented 1 year ago

@3dgiordano as requested I've used http://www.http2demo.io/ as a demo site it has both http1 and http2 resources

image

jmx example: please change .txt to .jmx as git is not alowing to upload jmx files bzm - HTTP2 Sampler.txt

Http2 plugin version: jmeter-bzm-http2-2.0.2

Java version: openjdk version "11.0.16.1" 2022-08-12 OpenJDK Runtime Environment Homebrew (build 11.0.16.1+0) OpenJDK 64-Bit Server VM Homebrew (build 11.0.16.1+0, mixed mode)

Jmeter version: 5.5

Thanks

3dgiordano commented 1 year ago

Thanks @serputko

3dgiordano commented 1 year ago

Hi @serputko

We finished carrying out the analysis of what you mentioned to us. You are correct, the embedded resource download execution model is not correct and requires work.

Thank you very much for reporting the problem to us. We will be working on solving the problem, which will be available in an upcoming release that we will carry out in the coming weeks.

Regards

3dgiordano commented 1 year ago

Hi @serputko

We made an initial support implementation of asynchronous execution in the plugin. In this preview release, we fixed some problems of downloading embedded resources in parallel for http2.

You can download and test the pre-release version in alpha in the releases section https://github.com/Blazemeter/jmeter-http2-plugin/releases/tag/v2.0.3-alpha

Let us know if it resolves what was reported in this issue.

3dgiordano commented 10 months ago

Hi @serputko

Final release of version 2.0.3 was done today. https://github.com/Blazemeter/jmeter-http2-plugin/releases/tag/v2.0.3

Soon it will be available in JMeter Plugins Manager.