Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88000 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40253 invoked from network); 2 Sep 2015 05:31:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2015 05:31:49 -0000 Authentication-Results: pb1.pair.com header.from=me@daveyshafik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@daveyshafik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daveyshafik.com from 209.85.160.178 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 209.85.160.178 mail-yk0-f178.google.com Received: from [209.85.160.178] ([209.85.160.178:36212] helo=mail-yk0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/55-23910-3C986E55 for ; Wed, 02 Sep 2015 01:31:48 -0400 Received: by ykcf206 with SMTP id f206so12700511ykc.3 for ; Tue, 01 Sep 2015 22:31:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:date:message-id:subject:from :to:content-type; bh=ZTMns0IWrwTedap+xBKqSCYw8+P+sYOfJwuF8xc/lkc=; b=duN4gF1mzTJ105tybA2a6vMEXpQVSlAwSU1gAcPwIMYZkUwUZYU4dFbM4oELwiHgXq 6qwiIl0tpXgNqViOsefXEYlSP9nhwxlsDKVNzahwfWsFmErRbTxwiMECHhJaYGuPDLzf j2UdS8HkQlAc23y+63kFH6t+qowgK3PWE9qTPBgs8f8Ysi07XcFwIM2j3TgpRtdX1N5/ RGkaVPJytby3db/ahrCIav32VTFfiyT+iVYTcq3AFBYBn8nAipugDERqu9qtKYiJQ2cl D52fHF4Rr+NekIiUM/nx5X8P51z2qdsF8XCgxpGfynbrjDvPKt9WaQBKRmMEYh4oeWX1 gPwg== X-Gm-Message-State: ALoCoQnyQBkJozHRSji+RTDFk1ThgaCoy215zYxv74+t1bkGFM0fMJZm5H5KqnSR7LD/w4KfWNqa MIME-Version: 1.0 X-Received: by 10.129.110.84 with SMTP id j81mr31775308ywc.6.1441171904737; Tue, 01 Sep 2015 22:31:44 -0700 (PDT) Sender: me@daveyshafik.com Received: by 10.129.55.136 with HTTP; Tue, 1 Sep 2015 22:31:44 -0700 (PDT) Date: Wed, 2 Sep 2015 17:31:44 +1200 X-Google-Sender-Auth: 9Y4tTJBdAbrZBGF0D7Tc2wVYdNA Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1149298c716dc0051ebcfbb6 Subject: Add HTTP/2 Multiplexing-related constants to ext/curl From: davey@php.net (Davey Shafik) --001a1149298c716dc0051ebcfbb6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 =E2=80=94 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 --001a1149298c716dc0051ebcfbb6--