cURL / Mailing Lists / curl-library / Single Mail


Re: Page load time comparison between h1 and h2 using libcurl

From: Rajiullah Shammi <>
Date: Mon, 16 May 2016 14:20:52 +0200


I can describe the whole test as follows:

1. For each test, I have 55 urls representing different objects in a real
page. You can find the urls and the object sizes here
2. libcurl version: curl-7.47.1, nghttp2/1.8.0-DEV. nghttpd for h2 server
with 150 maximum concurrent streams. ngnix for h1 server. I used the same
key and certificates for both
h1 and h2 cases
For h2
 nghttpd --htdocs=. --verbose --echo-upload --max-concurrent-streams=150
8000 key.pem cert.pem
for h1 (https) in server block
$ sudo vim /etc/nginx/sites-available/default
server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;
        listen 443 ssl;
        listen [::]:443 ipv6only=on ssl;

        root /usr/share/nginx/html;
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name localhost;

           # Enable SSL
    ssl_certificate /home/xx/cert.pem;
    ssl_certificate_key /home/xx/key.pem;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
    ssl_prefer_server_ciphers on;

3. I have both h1 and h2 servers running Linux ubuntu 14.04 in a virtual
machine. I put some delay in the server interface using netem to create a
10 ms RTT. I had my client attached to an 100 Mbps Ethernet. I haven’t
observed in loss in the TCP level.

4. I have also put the client code in the github (linked mentioned above)

Please let me know if I have missed something. Thanks.

Mohd. Rajiullah

On Mon, May 16, 2016 at 1:11 PM, Daniel Stenberg <> wrote:

> On Mon, 16 May 2016, Rajiullah Shammi wrote:
> I made a very simple performance test between h1 (https) and h2 in a no
>> loss scenario. With h1, I used 6 parallel connections to make 55 requests (
>> the number and size of the requests are taken from a real page). I did the
>> same with h2 using a single connection. Both of the clients are made based
>> on the example (10-at-a-time.c and http-download.c+https.c) given in
>> libcurl page. Basically, I was expecting both protocols should have given
>> similar performance (page load time). However, h2 turned out to be much
>> slower. So, I am not sure what I am missing here.
> Hello!
> Thanks for taking your time and running h1-h2 curl comparisons. We need
> this. The focus on the HTTP/2 implementation has so far been getting it
> technically right and working rather than to make sure that it offers
> stellar performance. But of course we need to learn about the flaws first
> to allow us to work on them.
> I'd be helpful if a comparison test would:
> 1. explain more about exactly what the test does for both protocols, in
> terms of connections, transfers and sizes
> 2. detail which libcurl version, nghttp2 version, TLS backend and version.
> And then possibly even making sure that the h1 and h2 versions are using
> the same TLS ciphers and configs. Which servers do you use for the test,
> any particular configs for that? What's the MAX_CONCURRENT_STREAMS value in
> the h2 case?
> 3. explain the network characteristics between the client and the server.
> What's the RTT time and expected bandwidth limit?
> 4. Maybe consider putting the source code for the test somewhere for
> inspection and ability to run tests in more places with other versions and
> other network setups.
> I appreciate the PCAPs attached, but I think it would be better to start
> out with the high level info mentioned above so that we better understand
> what to look for in those.
> --
> /
> -------------------------------------------------------------------
> List admin:
> Etiquette:

List admin:
Received on 2016-05-16