Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http2 POST delay #169

Closed
icing opened this issue Mar 17, 2015 · 8 comments
Closed

http2 POST delay #169

icing opened this issue Mar 17, 2015 · 8 comments
Assignees
Labels

Comments

@icing
Copy link
Contributor

icing commented Mar 17, 2015

When using curl --form file=@xxx .... against my server, there is a 1-2 second delay before curl actually sends the request body. Using the nghttp2 client does not show this behavior.

Might it be that this is some effect of Expect header handling, that just will not trigger in HTTP/2?

@bagder bagder self-assigned this Mar 17, 2015
@bagder bagder added the HTTP label Mar 17, 2015
@bagder
Copy link
Member

bagder commented Mar 17, 2015

Thanks. Does it show with a mere -d "fooo" (instead lf --form) as well ? I've not done a lot of posts over HTTP/2 so it is probably something like that lingering...

bagder added a commit that referenced this issue Mar 17, 2015
Reported-by: Stefan Eissing
Bug: #169
@bagder
Copy link
Member

bagder commented Mar 17, 2015

Just pushed commit ef1c3b4 which I believe fixes this.

@icing
Copy link
Contributor Author

icing commented Mar 18, 2015

Yes, that fixes it for the "h2" case (TLS). The "h2c" case, where no upgrade is triggered because of request content, it still seems unchanged slow. I see no delay, but the upload takes longer than in the TLS case. Some fallback code when nghttp2 does not kick in perhaps?

@bagder
Copy link
Member

bagder commented Mar 18, 2015

Isn't that just the ordinary Expect: 100-continue delay then? Try with -H Expect: and see if it changes anything!

@icing
Copy link
Contributor Author

icing commented Mar 18, 2015

As you can see below, the initial wait is gone in all cases, but the upload itself shows poor performance when --http2 is given. ('w. Expect' means -H Expect:)

Timings with curl from github (this morning):

curl https://test.example.org:12346/upload.py: 100k file upload default...
        0.22 real         0.01 user         0.00 sys
        0.03 real         0.01 user         0.00 sys
curl https://test.example.org:12346/upload.py: 100k file upload via http/2...
        0.22 real         0.01 user         0.00 sys
        0.03 real         0.01 user         0.00 sys
curl https://test.example.org:12346/upload.py: 100k file upload default w. Expect...
        0.22 real         0.01 user         0.00 sys
        0.03 real         0.01 user         0.00 sys
curl https://test.example.org:12346/upload.py: 100k file upload via http/2 w. Expect...
        0.22 real         0.01 user         0.00 sys
        0.03 real         0.01 user         0.00 sys
curl http://test.example.org:12345/upload.py: 100k file upload default...
        0.07 real         0.00 user         0.00 sys
        0.01 real         0.00 user         0.00 sys
curl http://test.example.org:12345/upload.py: 100k file upload via http/2...
        7.24 real         0.00 user         0.00 sys
        0.01 real         0.00 user         0.00 sys
curl http://test.example.org:12345/upload.py: 100k file upload default w. Expect...
        0.07 real         0.00 user         0.00 sys
        0.01 real         0.00 user         0.00 sys
curl http://test.example.org:12345/upload.py: 100k file upload via http/2 w. Expect...
        7.24 real         0.00 user         0.00 sys
        0.19 real         0.00 user         0.00 sys

Timings with curl 7.41.0:

curl https://test.example.org:12346/upload.py: 100k file upload default...
        0.09 real         0.01 user         0.00 sys
        0.03 real         0.01 user         0.00 sys
curl https://test.example.org:12346/upload.py: 100k file upload via http/2...
        4.05 real         0.01 user         0.00 sys
        0.03 real         0.01 user         0.00 sys
curl https://test.example.org:12346/upload.py: 100k file upload default w. Expect...
        0.09 real         0.01 user         0.00 sys
        0.03 real         0.01 user         0.00 sys
curl https://test.example.org:12346/upload.py: 100k file upload via http/2 w. Expect...
        0.22 real         0.01 user         0.00 sys
        0.03 real         0.01 user         0.00 sys
curl http://test.example.org:12345/upload.py: 100k file upload default...
        0.07 real         0.00 user         0.00 sys
        0.01 real         0.00 user         0.00 sys
curl http://test.example.org:12345/upload.py: 100k file upload via http/2...
        8.05 real         0.00 user         0.00 sys
        0.01 real         0.00 user         0.00 sys
curl http://test.example.org:12345/upload.py: 100k file upload default w. Expect...
        0.07 real         0.00 user         0.00 sys
        0.01 real         0.00 user         0.00 sys
curl http://test.example.org:12345/upload.py: 100k file upload via http/2 w. Expect...
        7.24 real         0.00 user         0.00 sys
        0.01 real         0.00 user         0.00 sys.

@bagder
Copy link
Member

bagder commented Mar 18, 2015

All right. Thanks a bunch for all the details. I guess I need to roll up my sleeves and check it out closer.

bagder added a commit that referenced this issue Mar 19, 2015
We prematurely changed protocol handler to HTTP/2 which made things very
slow (and wrong).

Reported-by: Stefan Eissing
Bug: #169
@bagder
Copy link
Member

bagder commented Mar 19, 2015

commit abfab17 fixes this problem for me at least.

Thanks again!

@icing
Copy link
Contributor Author

icing commented Mar 19, 2015

Yep. Works flawlessly. Thanks!

@icing icing closed this as completed Mar 19, 2015
@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants