Hi,
I've been poking around at HTTP/2 a lot lately, and it seems that so long
as you are using libcurl 7.43.0+ it's possible to do request multiplexing.
This change simply introduces three constants, CURLPIPE_NOTHING (0),
CURLPIPE_HTTP1 (1), and CURLPIPE_MULTIPLEX (2) which represent possible
values passed into curl_multi_setopt()
for the CURLMOPT_PIPELINING
option.
Current behavior of passing in 0 and 1 map to the first two constants,
while the third allows for multiplexing.
Now, of course, being constants, you can just pass in 0, 1, or 2, but this
brings the consistency and explicitness of exposing them as with all the
other curl constants.
I'd love to see this make it into PHP 7.0 if it's not too late? It's
extremely trivial, but whatever — not that fussed :)
PR is here: https://github.com/php/php-src/pull/1497
I'm not sure if there is some way to ensure that libcurl is compiled with
nghttp, but we don't check for the other HTTP/2 stuff so either it's done
elsewhere and I missed it, or we're making assumptions that the right
version is enough. Any input on this would be good.
FTR, multiplexing can bring substantial performance improvements,
especially when factoring in SSL:
379 HTTP SSL requests
Using HTTP/2 in serial: 63.293796062469 (HTTP/1.1 in serial should be even
slower)
Using HTTP/1.1 with curl_multi: 12.383034944534
Using HTTP/2 w/multiplexing: 2.7933928966522
Thanks,
- Davey
Hi,
Hi,
I've been poking around at HTTP/2 a lot lately, and it seems that so long
as you are using libcurl 7.43.0+ it's possible to do request multiplexing.This change simply introduces three constants, CURLPIPE_NOTHING (0),
CURLPIPE_HTTP1 (1), and CURLPIPE_MULTIPLEX (2) which represent possible
values passed intocurl_multi_setopt()
for theCURLMOPT_PIPELINING
option.
Current behavior of passing in 0 and 1 map to the first two constants,
while the third allows for multiplexing.Now, of course, being constants, you can just pass in 0, 1, or 2, but this
brings the consistency and explicitness of exposing them as with all the
other curl constants.I'd love to see this make it into PHP 7.0 if it's not too late? It's
extremely trivial, but whatever — not that fussed :)PR is here: https://github.com/php/php-src/pull/1497
I'm not sure if there is some way to ensure that libcurl is compiled with
nghttp, but we don't check for the other HTTP/2 stuff so either it's done
elsewhere and I missed it, or we're making assumptions that the right
version is enough. Any input on this would be good.FTR, multiplexing can bring substantial performance improvements,
especially when factoring in SSL:379 HTTP SSL requests
Using HTTP/2 in serial: 63.293796062469 (HTTP/1.1 in serial should be even
slower)
Using HTTP/1.1 with curl_multi: 12.383034944534
Using HTTP/2 w/multiplexing: 2.7933928966522
I think it should be fine as nothing is changed in the code but the
constants addition.
Let see what the RMs say :)
Hi Davey
2015-09-02 7:31 GMT+02:00 Davey Shafik davey@php.net:
Hi,
I've been poking around at HTTP/2 a lot lately, and it seems that so long
as you are using libcurl 7.43.0+ it's possible to do request multiplexing.This change simply introduces three constants, CURLPIPE_NOTHING (0),
CURLPIPE_HTTP1 (1), and CURLPIPE_MULTIPLEX (2) which represent possible
values passed intocurl_multi_setopt()
for theCURLMOPT_PIPELINING
option.
Current behavior of passing in 0 and 1 map to the first two constants,
while the third allows for multiplexing.Now, of course, being constants, you can just pass in 0, 1, or 2, but this
brings the consistency and explicitness of exposing them as with all the
other curl constants.I'd love to see this make it into PHP 7.0 if it's not too late? It's
extremely trivial, but whatever — not that fussed :)PR is here: https://github.com/php/php-src/pull/1497
Me and Anatol have talked it over and we're fine with this coming into
RC3 as it beats having hardcoded values in the code or ugly hacks for
7.0.0 only, so go ahead and commit the PR.
Thanks for your work :)
--
regards,
Kalle Sommer Nielsen
kalle@php.net
Hi Davey
2015-09-02 7:31 GMT+02:00 Davey Shafik davey@php.net:
Hi,
I've been poking around at HTTP/2 a lot lately, and it seems that so long
as you are using libcurl 7.43.0+ it's possible to do request multiplexing.This change simply introduces three constants, CURLPIPE_NOTHING (0),
CURLPIPE_HTTP1 (1), and CURLPIPE_MULTIPLEX (2) which represent possible
values passed intocurl_multi_setopt()
for theCURLMOPT_PIPELINING
option.
Current behavior of passing in 0 and 1 map to the first two constants,
while the third allows for multiplexing.Now, of course, being constants, you can just pass in 0, 1, or 2, but this
brings the consistency and explicitness of exposing them as with all the
other curl constants.I'd love to see this make it into PHP 7.0 if it's not too late? It's
extremely trivial, but whatever — not that fussed :)PR is here: https://github.com/php/php-src/pull/1497
Me and Anatol have talked it over and we're fine with this coming into
RC3 as it beats having hardcoded values in the code or ugly hacks for
7.0.0 only, so go ahead and commit the PR.Thanks for your work :)
Hey Kalle,
This is great... but I don't have karma to merge it I don't think? Be happy to be wrong :)
- Davey
Hi Davey
2015-09-04 16:47 GMT+02:00 Davey Shafik me@daveyshafik.com:
Hey Kalle,
This is great... but I don't have karma to merge it I don't think? Be happy to be wrong :)
Ah yes, I see you don't have php-src karma
(http://people.php.net/user.php?username=davey) I will make sure it
will be merged, unless you want the src karma and do it yourself :)
--
regards,
Kalle Sommer Nielsen
kalle@php.net