You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jakub Bartecek <jb...@redhat.com> on 2020/11/05 15:49:30 UTC

Re: HTTP/2 support in Maven

Hi,
I did a performance test of HTTP/2 and its comparison with HTTP/1.1 and I
would like to share my results with you.

I wrote a Python script [1] to download 100 artifacts in parallel using
asynchronous HTTP client supporting both HTTP/1.1 and HTTP/2. I chose 100
artifacts [2] from Maven Central, which were downloaded when I did a clean
build of one of my projects.

All 100 artifacts were downloaded using HTTP/1.1 and also HTTP/2 and I
stored the results in this file [3]. I did 10 experiments and measured its
performance. In the middle I switch the order of HTTP/1.1 and HTTP/2
requests to avoid a possible bias. I run it from my laptop connected to 160
Mbit/s network.

The experiments showed massive performance improvements when using HTTP/2
instead of HTTP/1.1
*:*

   - *The average download time using HTTP/1.1 was 3753.7 ms and using
   HTTP/2 971.8 ms* [4]


   - *In average the artifacts were downloaded 3.86 times faster using
   HTTP/2 than using HTTP/1.1* [5]


Kuba

[1]: https://github.com/jbartece/http2performance/blob/main/http2PerfTest.py
[2]: https://github.com/jbartece/http2performance/blob/main/centralUrls.txt
[3]: https://github.com/jbartece/http2performance/blob/main/testResults.txt
[4]:
https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L26
[5]:
https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L32


On Tue, Oct 27, 2020 at 8:42 AM Jakub Bartecek <jb...@redhat.com> wrote:

> I'll do some measurements and share the results with you. If it turns out
> that it is worth the effort, how much work does it require? I'm considering
> contributing it to Maven (or someone from my team).
>
> If it is contributed today, when can it be in an official Maven release?
>
> On Mon, Oct 26, 2020 at 7:09 PM Michael Osipov <mi...@apache.org>
> wrote:
>
>> Am 2020-10-26 um 15:01 schrieb Jakub Bartecek:
>> > On Sun, Oct 25, 2020 at 10:25 AM Michael Osipov <mi...@apache.org>
>> wrote:
>> >
>> >> Am 2020-10-23 um 10:08 schrieb Jakub Bartecek:
>> >>> Hello,
>> >>> I'd like to ask if it is possible to turn on HTTP/2 support in Maven.
>> I
>> >>> haven't found such an option.
>> >>>
>> >>> If not: Are there any plans to add the support?
>> >>
>> >> There is nothing to turn on and that would be unwise, something like
>> >> this should be done through ALPN.
>> >>
>> >> Maven uses by default Wagon HTTP Transport on top of Apache
>> >> HttpComponents 4.5.x. Beginning with Apache HttpComponent 5.0 HTTP/2 is
>> >> supported. One would need to write a new (updated) HTTP Transport to
>> >> move all gone.
>> >> There is one crucial issue needs to be solved first: HTTPCORE-626. Also
>> >> read the related discussion [1].
>> >>
>> >> Is there anything explicitly you expect from HTTP/2 compared to
>> >> HTTP/1.1? I have done a lot of internal improvements to Wagon HTTP this
>> >> year which covers a lot of use cases.
>> >>
>> >> Have you done testing with curl which proves some kind of improvement?
>> >> I have talked about possible benefits of HTTP/2 in corporate
>> >> environments with jfclere@ and he sees little benefit because when you
>> >> have a repo manager in house, you have (a) a gigabit connection and (b)
>> >> minimal hops between client and repo manager.
>> >>
>> >
>> > Thanks for the clarification.
>> >
>> > I wanted to test out if there are significant performance improvements
>> with
>> > HTTP/2 (which I hoped there could be),
>> > but I haven't done any measurements by simulating it with curl. My first
>> > idea was to try it with Maven directly
>>
>> Please do that first to have any numbers to compare. I don't see to put
>> any effort into something which will deliver a single digit percent
>> improvement given the amount of work.
>>
>> Share numbers when you are ready.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>

Re: HTTP/2 support in Maven

Posted by Jakub Bartecek <jb...@redhat.com>.
Yes, I think it does what you expected and it downloads the whole content
of the files. :-)

I did checks on the content size and it matches.
Honestly, your numbers are smth I expected to get - a small performance
improvement (~10%). I don't know why the difference is so high on my
laptop, but I'll test it today on some server.



On Thu, Nov 5, 2020 at 6:28 PM Jakub Bartecek <jb...@redhat.com> wrote:

> Hi,
> I'll look at it tomorrow and try to verify it really downloads the whole
> content, I did some checks on POM files and it really downloaded it.
>
> Thanks for testing it from your machine. It's interesting to see that you
> have completely different results. Honestly I'm not sure how that is
> possible, but I'll think about it more tomorrow. I'm about to call it a day
> now.
>
> Kuba
>
> On Thu, Nov 5, 2020 at 6:10 PM Tamás Cservenák <ta...@cservenak.net>
> wrote:
>
>> (short disclaimer: am not a python speaking person, so the change I did
>> above with intent to "consume response body, the artifact bytes" may not
>> did what I wanted :D)
>>
>

Re: HTTP/2 support in Maven

Posted by Tamás Cservenák <ta...@cservenak.net>.
Just FTR:

My HW:
cstamas@Urnebes ~/Worx/apache-maven/maven-resolver  (named)$ inxi
CPU: 6-Core Intel Core i7-7800X (-MT MCP-) speed/min/max: 1200/1200/4000
MHz Kernel: 5.8.0-25-generic x86_64 Up: 2h 32m
Mem: 8698.2/64029.4 MiB (13.6%) Storage: 6.36 TiB (4.6% used) Procs: 382
Shell: bash 5.0.17 inxi: 3.0.38
cstamas@Urnebes ~/Worx/apache-maven/maven-resolver  (named)$ uname -a
Linux Urnebes 5.8.0-25-generic #26~20.04.1-Ubuntu SMP Thu Oct 15 14:55:06
UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
cstamas@Urnebes ~/Worx/apache-maven/maven-resolver  (named)$ cat /etc/issue
Linux Mint 20 Ulyana \n \l

My net (as measured by https://netspeed.one/internet-speed-test/ )
ping 13 ms
jitter 1 ms
926/28 down/up

Python:
(linuxbrew installed) Python 3.9.0


HTH
Tamas



On Fri, Nov 6, 2020 at 10:05 AM Jakub Bartecek <jb...@redhat.com> wrote:

> I agree that the numbers I got are suspicious (I don't know why) and I'll
> try to get some numbers by running the script on a server. The reason might
> be that on my laptop the kernel / python starts with a smaller number of
> TCP connections and it waits for the first batch to complete before the
> next one is initiated. That might explain it and might also be a case in a
> real world. These are just my assumptions. I didn't find any other reason
> for it.
>
> But anyway I think that there are other benefits in the HTTP/2 than just
> server push. E.g. steam multiplexing over the same TCP connection,
> bidirectional communication, binary form of the protocol, header
> compression, ...
>
>
> On Thu, Nov 5, 2020 at 9:24 PM Benjamin Marwell <bm...@apache.org>
> wrote:
>
> > Well, if central supported h2 push, that would be a benefit!
> >
> > E.g. request shiro-web.jar and all the other dependencies would be
> pushed:
> > shiro-core.jar/.pom etc.
> >
> > Maven would need to figure out which one it needed, so it doesn't
> > redownload existing artifacts.
> >
> > So, no (or only marginal) gain without h2 server push.
> >
> > There may be other interesting mechanisms, but from what I've heard, push
> > is the most beneficial. And that's what I observed so far.
> >
> > On Thu, 5 Nov 2020, 19:49 Bernd Eckenfels, <ec...@zusammenkunft.net>
> wrote:
> >
> > > Hello,
> > >
> > > I don’t really see where http/2 should have a speed performance
> compared
> > > to http/1.1 as long as both use keepalive. For larger artifacts even
> the
> > > header reduction should be negectible. Having said that, it is of
> course
> > a
> > > good idea to go with the new protocols, but I would not expect much
> > > advantage. Especially not if you limit yourself to one or two tcp
> > > connections per repository.
> > >
> > > Gruss
> > > Bernd
> > > --
> > > http://bernd.eckenfels.net
> > > ________________________________
> > > Von: Jakub Bartecek <jb...@redhat.com>
> > > Gesendet: Thursday, November 5, 2020 6:28:05 PM
> > > An: Maven Users List <us...@maven.apache.org>
> > > Betreff: Re: HTTP/2 support in Maven
> > >
> > > Hi,
> > > I'll look at it tomorrow and try to verify it really downloads the
> whole
> > > content, I did some checks on POM files and it really downloaded it.
> > >
> > > Thanks for testing it from your machine. It's interesting to see that
> you
> > > have completely different results. Honestly I'm not sure how that is
> > > possible, but I'll think about it more tomorrow. I'm about to call it a
> > day
> > > now.
> > >
> > > Kuba
> > >
> > > On Thu, Nov 5, 2020 at 6:10 PM Tamás Cservenák <ta...@cservenak.net>
> > > wrote:
> > >
> > > > (short disclaimer: am not a python speaking person, so the change I
> did
> > > > above with intent to "consume response body, the artifact bytes" may
> > not
> > > > did what I wanted :D)
> > > >
> > >
> >
>

Re: HTTP/2 support in Maven

Posted by Jakub Bartecek <jb...@redhat.com>.
I agree that the numbers I got are suspicious (I don't know why) and I'll
try to get some numbers by running the script on a server. The reason might
be that on my laptop the kernel / python starts with a smaller number of
TCP connections and it waits for the first batch to complete before the
next one is initiated. That might explain it and might also be a case in a
real world. These are just my assumptions. I didn't find any other reason
for it.

But anyway I think that there are other benefits in the HTTP/2 than just
server push. E.g. steam multiplexing over the same TCP connection,
bidirectional communication, binary form of the protocol, header
compression, ...


On Thu, Nov 5, 2020 at 9:24 PM Benjamin Marwell <bm...@apache.org> wrote:

> Well, if central supported h2 push, that would be a benefit!
>
> E.g. request shiro-web.jar and all the other dependencies would be pushed:
> shiro-core.jar/.pom etc.
>
> Maven would need to figure out which one it needed, so it doesn't
> redownload existing artifacts.
>
> So, no (or only marginal) gain without h2 server push.
>
> There may be other interesting mechanisms, but from what I've heard, push
> is the most beneficial. And that's what I observed so far.
>
> On Thu, 5 Nov 2020, 19:49 Bernd Eckenfels, <ec...@zusammenkunft.net> wrote:
>
> > Hello,
> >
> > I don’t really see where http/2 should have a speed performance compared
> > to http/1.1 as long as both use keepalive. For larger artifacts even the
> > header reduction should be negectible. Having said that, it is of course
> a
> > good idea to go with the new protocols, but I would not expect much
> > advantage. Especially not if you limit yourself to one or two tcp
> > connections per repository.
> >
> > Gruss
> > Bernd
> > --
> > http://bernd.eckenfels.net
> > ________________________________
> > Von: Jakub Bartecek <jb...@redhat.com>
> > Gesendet: Thursday, November 5, 2020 6:28:05 PM
> > An: Maven Users List <us...@maven.apache.org>
> > Betreff: Re: HTTP/2 support in Maven
> >
> > Hi,
> > I'll look at it tomorrow and try to verify it really downloads the whole
> > content, I did some checks on POM files and it really downloaded it.
> >
> > Thanks for testing it from your machine. It's interesting to see that you
> > have completely different results. Honestly I'm not sure how that is
> > possible, but I'll think about it more tomorrow. I'm about to call it a
> day
> > now.
> >
> > Kuba
> >
> > On Thu, Nov 5, 2020 at 6:10 PM Tamás Cservenák <ta...@cservenak.net>
> > wrote:
> >
> > > (short disclaimer: am not a python speaking person, so the change I did
> > > above with intent to "consume response body, the artifact bytes" may
> not
> > > did what I wanted :D)
> > >
> >
>

Re: HTTP/2 support in Maven

Posted by Benjamin Marwell <bm...@apache.org>.
Well, if central supported h2 push, that would be a benefit!

E.g. request shiro-web.jar and all the other dependencies would be pushed:
shiro-core.jar/.pom etc.

Maven would need to figure out which one it needed, so it doesn't
redownload existing artifacts.

So, no (or only marginal) gain without h2 server push.

There may be other interesting mechanisms, but from what I've heard, push
is the most beneficial. And that's what I observed so far.

On Thu, 5 Nov 2020, 19:49 Bernd Eckenfels, <ec...@zusammenkunft.net> wrote:

> Hello,
>
> I don’t really see where http/2 should have a speed performance compared
> to http/1.1 as long as both use keepalive. For larger artifacts even the
> header reduction should be negectible. Having said that, it is of course a
> good idea to go with the new protocols, but I would not expect much
> advantage. Especially not if you limit yourself to one or two tcp
> connections per repository.
>
> Gruss
> Bernd
> --
> http://bernd.eckenfels.net
> ________________________________
> Von: Jakub Bartecek <jb...@redhat.com>
> Gesendet: Thursday, November 5, 2020 6:28:05 PM
> An: Maven Users List <us...@maven.apache.org>
> Betreff: Re: HTTP/2 support in Maven
>
> Hi,
> I'll look at it tomorrow and try to verify it really downloads the whole
> content, I did some checks on POM files and it really downloaded it.
>
> Thanks for testing it from your machine. It's interesting to see that you
> have completely different results. Honestly I'm not sure how that is
> possible, but I'll think about it more tomorrow. I'm about to call it a day
> now.
>
> Kuba
>
> On Thu, Nov 5, 2020 at 6:10 PM Tamás Cservenák <ta...@cservenak.net>
> wrote:
>
> > (short disclaimer: am not a python speaking person, so the change I did
> > above with intent to "consume response body, the artifact bytes" may not
> > did what I wanted :D)
> >
>

Re: HTTP/2 support in Maven

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
Hello,

I don’t really see where http/2 should have a speed performance compared to http/1.1 as long as both use keepalive. For larger artifacts even the header reduction should be negectible. Having said that, it is of course a good idea to go with the new protocols, but I would not expect much advantage. Especially not if you limit yourself to one or two tcp connections per repository.

Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
Von: Jakub Bartecek <jb...@redhat.com>
Gesendet: Thursday, November 5, 2020 6:28:05 PM
An: Maven Users List <us...@maven.apache.org>
Betreff: Re: HTTP/2 support in Maven

Hi,
I'll look at it tomorrow and try to verify it really downloads the whole
content, I did some checks on POM files and it really downloaded it.

Thanks for testing it from your machine. It's interesting to see that you
have completely different results. Honestly I'm not sure how that is
possible, but I'll think about it more tomorrow. I'm about to call it a day
now.

Kuba

On Thu, Nov 5, 2020 at 6:10 PM Tamás Cservenák <ta...@cservenak.net> wrote:

> (short disclaimer: am not a python speaking person, so the change I did
> above with intent to "consume response body, the artifact bytes" may not
> did what I wanted :D)
>

Re: HTTP/2 support in Maven

Posted by Jakub Bartecek <jb...@redhat.com>.
Hi,
I'll look at it tomorrow and try to verify it really downloads the whole
content, I did some checks on POM files and it really downloaded it.

Thanks for testing it from your machine. It's interesting to see that you
have completely different results. Honestly I'm not sure how that is
possible, but I'll think about it more tomorrow. I'm about to call it a day
now.

Kuba

On Thu, Nov 5, 2020 at 6:10 PM Tamás Cservenák <ta...@cservenak.net> wrote:

> (short disclaimer: am not a python speaking person, so the change I did
> above with intent to "consume response body, the artifact bytes" may not
> did what I wanted :D)
>

Re: HTTP/2 support in Maven

Posted by Tamás Cservenák <ta...@cservenak.net>.
(short disclaimer: am not a python speaking person, so the change I did
above with intent to "consume response body, the artifact bytes" may not
did what I wanted :D)

Re: HTTP/2 support in Maven

Posted by Tamás Cservenák <ta...@cservenak.net>.
https://gist.github.com/cstamas/f87a12920d3c28e5db024dcd2f1a5d5f

Given almost the same times, it seems it did consume :)

Still, the factor of 3.8 is not seen by me....
(plain cable modem)

Thanks
T

On Thu, Nov 5, 2020 at 5:23 PM Tamás Cservenák <ta...@cservenak.net> wrote:

> I ran your script _unchanged_ on my machine and got this result:
> https://gist.github.com/cstamas/b70f85ad601e5e2f399596b2e8cec7d1
>
> Interestingly, http1 is quite "stable" -- roughly around 800ms
> while http2 is quite "jumpy" -- goes from 600 to 920ms
>
> Will try to add change to get the response content as well....
>
> Thanks
> T
>
> On Thu, Nov 5, 2020 at 5:09 PM Tamás Cservenák <ta...@cservenak.net>
> wrote:
>
>> Hi Kuba,
>>
>> Can you clarify what exactly your script does re "download"?
>> It seems it issues HTTP GET, but does it fully consume response?
>> Does it get all the bytes of the artifact, or just the parses response
>> header(s) and throws the rest?
>>
>> Thanks
>> T
>>
>> On Thu, Nov 5, 2020 at 4:49 PM Jakub Bartecek <jb...@redhat.com>
>> wrote:
>>
>>> Hi,
>>> I did a performance test of HTTP/2 and its comparison with HTTP/1.1 and I
>>> would like to share my results with you.
>>>
>>> I wrote a Python script [1] to download 100 artifacts in parallel using
>>> asynchronous HTTP client supporting both HTTP/1.1 and HTTP/2. I chose 100
>>> artifacts [2] from Maven Central, which were downloaded when I did a
>>> clean
>>> build of one of my projects.
>>>
>>> All 100 artifacts were downloaded using HTTP/1.1 and also HTTP/2 and I
>>> stored the results in this file [3]. I did 10 experiments and measured
>>> its
>>> performance. In the middle I switch the order of HTTP/1.1 and HTTP/2
>>> requests to avoid a possible bias. I run it from my laptop connected to
>>> 160
>>> Mbit/s network.
>>>
>>> The experiments showed massive performance improvements when using HTTP/2
>>> instead of HTTP/1.1
>>> *:*
>>>
>>>    - *The average download time using HTTP/1.1 was 3753.7 ms and using
>>>    HTTP/2 971.8 ms* [4]
>>>
>>>
>>>    - *In average the artifacts were downloaded 3.86 times faster using
>>>    HTTP/2 than using HTTP/1.1* [5]
>>>
>>>
>>> Kuba
>>>
>>> [1]:
>>> https://github.com/jbartece/http2performance/blob/main/http2PerfTest.py
>>> [2]:
>>> https://github.com/jbartece/http2performance/blob/main/centralUrls.txt
>>> [3]:
>>> https://github.com/jbartece/http2performance/blob/main/testResults.txt
>>> [4]:
>>>
>>> https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L26
>>> [5]:
>>>
>>> https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L32
>>>
>>>
>>> On Tue, Oct 27, 2020 at 8:42 AM Jakub Bartecek <jb...@redhat.com>
>>> wrote:
>>>
>>> > I'll do some measurements and share the results with you. If it turns
>>> out
>>> > that it is worth the effort, how much work does it require? I'm
>>> considering
>>> > contributing it to Maven (or someone from my team).
>>> >
>>> > If it is contributed today, when can it be in an official Maven
>>> release?
>>> >
>>> > On Mon, Oct 26, 2020 at 7:09 PM Michael Osipov <mi...@apache.org>
>>> > wrote:
>>> >
>>> >> Am 2020-10-26 um 15:01 schrieb Jakub Bartecek:
>>> >> > On Sun, Oct 25, 2020 at 10:25 AM Michael Osipov <
>>> michaelo@apache.org>
>>> >> wrote:
>>> >> >
>>> >> >> Am 2020-10-23 um 10:08 schrieb Jakub Bartecek:
>>> >> >>> Hello,
>>> >> >>> I'd like to ask if it is possible to turn on HTTP/2 support in
>>> Maven.
>>> >> I
>>> >> >>> haven't found such an option.
>>> >> >>>
>>> >> >>> If not: Are there any plans to add the support?
>>> >> >>
>>> >> >> There is nothing to turn on and that would be unwise, something
>>> like
>>> >> >> this should be done through ALPN.
>>> >> >>
>>> >> >> Maven uses by default Wagon HTTP Transport on top of Apache
>>> >> >> HttpComponents 4.5.x. Beginning with Apache HttpComponent 5.0
>>> HTTP/2 is
>>> >> >> supported. One would need to write a new (updated) HTTP Transport
>>> to
>>> >> >> move all gone.
>>> >> >> There is one crucial issue needs to be solved first: HTTPCORE-626.
>>> Also
>>> >> >> read the related discussion [1].
>>> >> >>
>>> >> >> Is there anything explicitly you expect from HTTP/2 compared to
>>> >> >> HTTP/1.1? I have done a lot of internal improvements to Wagon HTTP
>>> this
>>> >> >> year which covers a lot of use cases.
>>> >> >>
>>> >> >> Have you done testing with curl which proves some kind of
>>> improvement?
>>> >> >> I have talked about possible benefits of HTTP/2 in corporate
>>> >> >> environments with jfclere@ and he sees little benefit because
>>> when you
>>> >> >> have a repo manager in house, you have (a) a gigabit connection
>>> and (b)
>>> >> >> minimal hops between client and repo manager.
>>> >> >>
>>> >> >
>>> >> > Thanks for the clarification.
>>> >> >
>>> >> > I wanted to test out if there are significant performance
>>> improvements
>>> >> with
>>> >> > HTTP/2 (which I hoped there could be),
>>> >> > but I haven't done any measurements by simulating it with curl. My
>>> first
>>> >> > idea was to try it with Maven directly
>>> >>
>>> >> Please do that first to have any numbers to compare. I don't see to
>>> put
>>> >> any effort into something which will deliver a single digit percent
>>> >> improvement given the amount of work.
>>> >>
>>> >> Share numbers when you are ready.
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> >> For additional commands, e-mail: users-help@maven.apache.org
>>> >>
>>> >>
>>>
>>

Re: HTTP/2 support in Maven

Posted by Tamás Cservenák <ta...@cservenak.net>.
I ran your script _unchanged_ on my machine and got this result:
https://gist.github.com/cstamas/b70f85ad601e5e2f399596b2e8cec7d1

Interestingly, http1 is quite "stable" -- roughly around 800ms
while http2 is quite "jumpy" -- goes from 600 to 920ms

Will try to add change to get the response content as well....

Thanks
T

On Thu, Nov 5, 2020 at 5:09 PM Tamás Cservenák <ta...@cservenak.net> wrote:

> Hi Kuba,
>
> Can you clarify what exactly your script does re "download"?
> It seems it issues HTTP GET, but does it fully consume response?
> Does it get all the bytes of the artifact, or just the parses response
> header(s) and throws the rest?
>
> Thanks
> T
>
> On Thu, Nov 5, 2020 at 4:49 PM Jakub Bartecek <jb...@redhat.com> wrote:
>
>> Hi,
>> I did a performance test of HTTP/2 and its comparison with HTTP/1.1 and I
>> would like to share my results with you.
>>
>> I wrote a Python script [1] to download 100 artifacts in parallel using
>> asynchronous HTTP client supporting both HTTP/1.1 and HTTP/2. I chose 100
>> artifacts [2] from Maven Central, which were downloaded when I did a clean
>> build of one of my projects.
>>
>> All 100 artifacts were downloaded using HTTP/1.1 and also HTTP/2 and I
>> stored the results in this file [3]. I did 10 experiments and measured its
>> performance. In the middle I switch the order of HTTP/1.1 and HTTP/2
>> requests to avoid a possible bias. I run it from my laptop connected to
>> 160
>> Mbit/s network.
>>
>> The experiments showed massive performance improvements when using HTTP/2
>> instead of HTTP/1.1
>> *:*
>>
>>    - *The average download time using HTTP/1.1 was 3753.7 ms and using
>>    HTTP/2 971.8 ms* [4]
>>
>>
>>    - *In average the artifacts were downloaded 3.86 times faster using
>>    HTTP/2 than using HTTP/1.1* [5]
>>
>>
>> Kuba
>>
>> [1]:
>> https://github.com/jbartece/http2performance/blob/main/http2PerfTest.py
>> [2]:
>> https://github.com/jbartece/http2performance/blob/main/centralUrls.txt
>> [3]:
>> https://github.com/jbartece/http2performance/blob/main/testResults.txt
>> [4]:
>>
>> https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L26
>> [5]:
>>
>> https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L32
>>
>>
>> On Tue, Oct 27, 2020 at 8:42 AM Jakub Bartecek <jb...@redhat.com>
>> wrote:
>>
>> > I'll do some measurements and share the results with you. If it turns
>> out
>> > that it is worth the effort, how much work does it require? I'm
>> considering
>> > contributing it to Maven (or someone from my team).
>> >
>> > If it is contributed today, when can it be in an official Maven release?
>> >
>> > On Mon, Oct 26, 2020 at 7:09 PM Michael Osipov <mi...@apache.org>
>> > wrote:
>> >
>> >> Am 2020-10-26 um 15:01 schrieb Jakub Bartecek:
>> >> > On Sun, Oct 25, 2020 at 10:25 AM Michael Osipov <michaelo@apache.org
>> >
>> >> wrote:
>> >> >
>> >> >> Am 2020-10-23 um 10:08 schrieb Jakub Bartecek:
>> >> >>> Hello,
>> >> >>> I'd like to ask if it is possible to turn on HTTP/2 support in
>> Maven.
>> >> I
>> >> >>> haven't found such an option.
>> >> >>>
>> >> >>> If not: Are there any plans to add the support?
>> >> >>
>> >> >> There is nothing to turn on and that would be unwise, something like
>> >> >> this should be done through ALPN.
>> >> >>
>> >> >> Maven uses by default Wagon HTTP Transport on top of Apache
>> >> >> HttpComponents 4.5.x. Beginning with Apache HttpComponent 5.0
>> HTTP/2 is
>> >> >> supported. One would need to write a new (updated) HTTP Transport to
>> >> >> move all gone.
>> >> >> There is one crucial issue needs to be solved first: HTTPCORE-626.
>> Also
>> >> >> read the related discussion [1].
>> >> >>
>> >> >> Is there anything explicitly you expect from HTTP/2 compared to
>> >> >> HTTP/1.1? I have done a lot of internal improvements to Wagon HTTP
>> this
>> >> >> year which covers a lot of use cases.
>> >> >>
>> >> >> Have you done testing with curl which proves some kind of
>> improvement?
>> >> >> I have talked about possible benefits of HTTP/2 in corporate
>> >> >> environments with jfclere@ and he sees little benefit because when
>> you
>> >> >> have a repo manager in house, you have (a) a gigabit connection and
>> (b)
>> >> >> minimal hops between client and repo manager.
>> >> >>
>> >> >
>> >> > Thanks for the clarification.
>> >> >
>> >> > I wanted to test out if there are significant performance
>> improvements
>> >> with
>> >> > HTTP/2 (which I hoped there could be),
>> >> > but I haven't done any measurements by simulating it with curl. My
>> first
>> >> > idea was to try it with Maven directly
>> >>
>> >> Please do that first to have any numbers to compare. I don't see to put
>> >> any effort into something which will deliver a single digit percent
>> >> improvement given the amount of work.
>> >>
>> >> Share numbers when you are ready.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: users-help@maven.apache.org
>> >>
>> >>
>>
>

Re: HTTP/2 support in Maven

Posted by Tamás Cservenák <ta...@cservenak.net>.
Hi Kuba,

Can you clarify what exactly your script does re "download"?
It seems it issues HTTP GET, but does it fully consume response?
Does it get all the bytes of the artifact, or just the parses response
header(s) and throws the rest?

Thanks
T

On Thu, Nov 5, 2020 at 4:49 PM Jakub Bartecek <jb...@redhat.com> wrote:

> Hi,
> I did a performance test of HTTP/2 and its comparison with HTTP/1.1 and I
> would like to share my results with you.
>
> I wrote a Python script [1] to download 100 artifacts in parallel using
> asynchronous HTTP client supporting both HTTP/1.1 and HTTP/2. I chose 100
> artifacts [2] from Maven Central, which were downloaded when I did a clean
> build of one of my projects.
>
> All 100 artifacts were downloaded using HTTP/1.1 and also HTTP/2 and I
> stored the results in this file [3]. I did 10 experiments and measured its
> performance. In the middle I switch the order of HTTP/1.1 and HTTP/2
> requests to avoid a possible bias. I run it from my laptop connected to 160
> Mbit/s network.
>
> The experiments showed massive performance improvements when using HTTP/2
> instead of HTTP/1.1
> *:*
>
>    - *The average download time using HTTP/1.1 was 3753.7 ms and using
>    HTTP/2 971.8 ms* [4]
>
>
>    - *In average the artifacts were downloaded 3.86 times faster using
>    HTTP/2 than using HTTP/1.1* [5]
>
>
> Kuba
>
> [1]:
> https://github.com/jbartece/http2performance/blob/main/http2PerfTest.py
> [2]:
> https://github.com/jbartece/http2performance/blob/main/centralUrls.txt
> [3]:
> https://github.com/jbartece/http2performance/blob/main/testResults.txt
> [4]:
> https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L26
> [5]:
> https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L32
>
>
> On Tue, Oct 27, 2020 at 8:42 AM Jakub Bartecek <jb...@redhat.com>
> wrote:
>
> > I'll do some measurements and share the results with you. If it turns out
> > that it is worth the effort, how much work does it require? I'm
> considering
> > contributing it to Maven (or someone from my team).
> >
> > If it is contributed today, when can it be in an official Maven release?
> >
> > On Mon, Oct 26, 2020 at 7:09 PM Michael Osipov <mi...@apache.org>
> > wrote:
> >
> >> Am 2020-10-26 um 15:01 schrieb Jakub Bartecek:
> >> > On Sun, Oct 25, 2020 at 10:25 AM Michael Osipov <mi...@apache.org>
> >> wrote:
> >> >
> >> >> Am 2020-10-23 um 10:08 schrieb Jakub Bartecek:
> >> >>> Hello,
> >> >>> I'd like to ask if it is possible to turn on HTTP/2 support in
> Maven.
> >> I
> >> >>> haven't found such an option.
> >> >>>
> >> >>> If not: Are there any plans to add the support?
> >> >>
> >> >> There is nothing to turn on and that would be unwise, something like
> >> >> this should be done through ALPN.
> >> >>
> >> >> Maven uses by default Wagon HTTP Transport on top of Apache
> >> >> HttpComponents 4.5.x. Beginning with Apache HttpComponent 5.0 HTTP/2
> is
> >> >> supported. One would need to write a new (updated) HTTP Transport to
> >> >> move all gone.
> >> >> There is one crucial issue needs to be solved first: HTTPCORE-626.
> Also
> >> >> read the related discussion [1].
> >> >>
> >> >> Is there anything explicitly you expect from HTTP/2 compared to
> >> >> HTTP/1.1? I have done a lot of internal improvements to Wagon HTTP
> this
> >> >> year which covers a lot of use cases.
> >> >>
> >> >> Have you done testing with curl which proves some kind of
> improvement?
> >> >> I have talked about possible benefits of HTTP/2 in corporate
> >> >> environments with jfclere@ and he sees little benefit because when
> you
> >> >> have a repo manager in house, you have (a) a gigabit connection and
> (b)
> >> >> minimal hops between client and repo manager.
> >> >>
> >> >
> >> > Thanks for the clarification.
> >> >
> >> > I wanted to test out if there are significant performance improvements
> >> with
> >> > HTTP/2 (which I hoped there could be),
> >> > but I haven't done any measurements by simulating it with curl. My
> first
> >> > idea was to try it with Maven directly
> >>
> >> Please do that first to have any numbers to compare. I don't see to put
> >> any effort into something which will deliver a single digit percent
> >> improvement given the amount of work.
> >>
> >> Share numbers when you are ready.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
>

Re: HTTP/2 support in Maven

Posted by Jakub Bartecek <jb...@redhat.com>.
Hi,
we have done a bit more testing in a proper isolated perf environment using
a Java application (added to the same repo) [1]:


JDK Java HTTP/1.1: 3166.41 / 10 = 316.641 ± 64.438 ms
JDK Java HTTP/2: 3008.88 / 10 = 300.888 ± 34.369 ms
Apache HTTP/1.1: 10916.22 / 10 = 1091.622 ± 354.572 ms
Apache HTTP/2: 5612.91 / 10 = 561.291 ± 76.835 ms

JDK Java was 5.23% improvement
Apache was 94.48% improvement

$ uname -a
Linux burtha-f31 5.8.17-100.fc31.x86_64 #1 SMP Thu Oct 29 18:58:48 UTC
2020 x86_64 x86_64 x86_64 GNU/Linux
$ java -version
openjdk version "11.0.9" 2020-10-20
OpenJDK Runtime Environment 18.9 (build 11.0.9+11)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.9+11, mixed mode, sharing)
$
Intel(R) Core(TM) i7 CPU       X 990  @ 3.47GHz

For the plain queries there was a small 5% improvement, in the Apache
implementation it looks like there is much higher difference. The times
between JDK and Apache implementation cannot be compared directly as the
Apache implementation reads strings in a handler. I have no idea, why I got
so crazy numbers  when testing on my laptop, but these numbers look
reasonable (although running the same scripts on my laptop I'm getting
again much higher performance improvements with HTTP/2).

Re server push: Probably some smart logic might be implemented in a server
as already mentioned. Pushing checksums should be also easy.

Kuba


[1]: https://github.com/jbartece/http2performance/tree/main/httpMetrics

On Mon, Nov 9, 2020 at 6:30 PM Benjamin Marwell <bm...@apache.org> wrote:

> Hi Michael,
>
> I do not think it is necessary to download ALL of them serially. H2
> Server push might become a big advantage as already mentioned.
> e.g. if requesting a pom, it might push the jar and its dependencies
> right away with it.
> THAT would probably save a lot of connections (and time).
>
> The only problem is that we would need server support for this (h2 push)
> first.
>
> Am Mo., 9. Nov. 2020 um 16:35 Uhr schrieb Michael Osipov <
> michaelo@apache.org>:
> >
> > Am 2020-11-05 um 16:49 schrieb Jakub Bartecek:
> > > Hi,
> > > I did a performance test of HTTP/2 and its comparison with HTTP/1.1
> and I
> > > would like to share my results with you.
> > >
> > > I wrote a Python script [1] to download 100 artifacts in parallel using
> > > asynchronous HTTP client supporting both HTTP/1.1 and HTTP/2. I chose
> 100
> > > artifacts [2] from Maven Central, which were downloaded when I did a
> clean
> > > build of one of my projects.
> > >
> > > All 100 artifacts were downloaded using HTTP/1.1 and also HTTP/2 and I
> > > stored the results in this file [3]. I did 10 experiments and measured
> its
> > > performance. In the middle I switch the order of HTTP/1.1 and HTTP/2
> > > requests to avoid a possible bias. I run it from my laptop connected
> to 160
> > > Mbit/s network.
> > >
> > > The experiments showed massive performance improvements when using
> HTTP/2
> > > instead of HTTP/1.1
> > > *:*
> > >
> > >     - *The average download time using HTTP/1.1 was 3753.7 ms and using
> > >     HTTP/2 971.8 ms* [4]
> > >
> > >
> > >     - *In average the artifacts were downloaded 3.86 times faster using
> > >     HTTP/2 than using HTTP/1.1* [5]
> > >
> > >
> > > Kuba
> > >
> > > [1]:
> https://github.com/jbartece/http2performance/blob/main/http2PerfTest.py
> > > [2]:
> https://github.com/jbartece/http2performance/blob/main/centralUrls.txt
> > > [3]:
> https://github.com/jbartece/http2performance/blob/main/testResults.txt
> > > [4]:
> > >
> https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L26
> > > [5]:
> > >
> https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L32
> >
> > This testing is logically wrong/incomplete. You have to download
> > serially maven-metadata.xml, its checksum files, POM, its checkfiles and
> > artifact itself and its checksum files. Please redo, I would to to test
> > this too then. Enable HttpClient debug logging to see that more than
> > just the JAR is downloaded.
> >
> > Michael
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: HTTP/2 support in Maven

Posted by Benjamin Marwell <bm...@apache.org>.
Hi Michael,

I do not think it is necessary to download ALL of them serially. H2
Server push might become a big advantage as already mentioned.
e.g. if requesting a pom, it might push the jar and its dependencies
right away with it.
THAT would probably save a lot of connections (and time).

The only problem is that we would need server support for this (h2 push) first.

Am Mo., 9. Nov. 2020 um 16:35 Uhr schrieb Michael Osipov <mi...@apache.org>:
>
> Am 2020-11-05 um 16:49 schrieb Jakub Bartecek:
> > Hi,
> > I did a performance test of HTTP/2 and its comparison with HTTP/1.1 and I
> > would like to share my results with you.
> >
> > I wrote a Python script [1] to download 100 artifacts in parallel using
> > asynchronous HTTP client supporting both HTTP/1.1 and HTTP/2. I chose 100
> > artifacts [2] from Maven Central, which were downloaded when I did a clean
> > build of one of my projects.
> >
> > All 100 artifacts were downloaded using HTTP/1.1 and also HTTP/2 and I
> > stored the results in this file [3]. I did 10 experiments and measured its
> > performance. In the middle I switch the order of HTTP/1.1 and HTTP/2
> > requests to avoid a possible bias. I run it from my laptop connected to 160
> > Mbit/s network.
> >
> > The experiments showed massive performance improvements when using HTTP/2
> > instead of HTTP/1.1
> > *:*
> >
> >     - *The average download time using HTTP/1.1 was 3753.7 ms and using
> >     HTTP/2 971.8 ms* [4]
> >
> >
> >     - *In average the artifacts were downloaded 3.86 times faster using
> >     HTTP/2 than using HTTP/1.1* [5]
> >
> >
> > Kuba
> >
> > [1]: https://github.com/jbartece/http2performance/blob/main/http2PerfTest.py
> > [2]: https://github.com/jbartece/http2performance/blob/main/centralUrls.txt
> > [3]: https://github.com/jbartece/http2performance/blob/main/testResults.txt
> > [4]:
> > https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L26
> > [5]:
> > https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L32
>
> This testing is logically wrong/incomplete. You have to download
> serially maven-metadata.xml, its checksum files, POM, its checkfiles and
> artifact itself and its checksum files. Please redo, I would to to test
> this too then. Enable HttpClient debug logging to see that more than
> just the JAR is downloaded.
>
> Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: HTTP/2 support in Maven

Posted by Michael Osipov <mi...@apache.org>.
Am 2020-11-05 um 16:49 schrieb Jakub Bartecek:
> Hi,
> I did a performance test of HTTP/2 and its comparison with HTTP/1.1 and I
> would like to share my results with you.
> 
> I wrote a Python script [1] to download 100 artifacts in parallel using
> asynchronous HTTP client supporting both HTTP/1.1 and HTTP/2. I chose 100
> artifacts [2] from Maven Central, which were downloaded when I did a clean
> build of one of my projects.
> 
> All 100 artifacts were downloaded using HTTP/1.1 and also HTTP/2 and I
> stored the results in this file [3]. I did 10 experiments and measured its
> performance. In the middle I switch the order of HTTP/1.1 and HTTP/2
> requests to avoid a possible bias. I run it from my laptop connected to 160
> Mbit/s network.
> 
> The experiments showed massive performance improvements when using HTTP/2
> instead of HTTP/1.1
> *:*
> 
>     - *The average download time using HTTP/1.1 was 3753.7 ms and using
>     HTTP/2 971.8 ms* [4]
> 
> 
>     - *In average the artifacts were downloaded 3.86 times faster using
>     HTTP/2 than using HTTP/1.1* [5]
> 
> 
> Kuba
> 
> [1]: https://github.com/jbartece/http2performance/blob/main/http2PerfTest.py
> [2]: https://github.com/jbartece/http2performance/blob/main/centralUrls.txt
> [3]: https://github.com/jbartece/http2performance/blob/main/testResults.txt
> [4]:
> https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L26
> [5]:
> https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L32

This testing is logically wrong/incomplete. You have to download 
serially maven-metadata.xml, its checksum files, POM, its checkfiles and 
artifact itself and its checksum files. Please redo, I would to to test 
this too then. Enable HttpClient debug logging to see that more than 
just the JAR is downloaded.

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org