Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82023 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89220 invoked from network); 6 Feb 2015 07:55:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2015 07:55:43 -0000 Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:46505] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0E/A8-45146-E7374D45 for ; Fri, 06 Feb 2015 02:55:42 -0500 Received: by mail-wi0-f182.google.com with SMTP id n3so410151wiv.3 for ; Thu, 05 Feb 2015 23:55:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=4Lf+UgzuVf7Z7EDofxSMn2C4E8JL92RAvy4TawLehb0=; b=JtlqmqmpGF6b5JT7BtchWvhjwl5B4UeRmI4xWXQtyczE7z2YSA+endBJsROCLBCZLt JQCAe2x2EM3KwHIye9ivQPXbWg4WSC3VJJJS6LV/DjJbMdaQtEvqIcM8v8o1D7OcFynR J3rf0yRn4DkhW3moMxlMqTOnUf2fprZMbaiF5s9gNhnxv8yvVW7T0Yup0BwH9i0GtoDX MTG8bNpBYlqBW8Ff4VJso4VU+YIxuWecEj7dk0hvu0e+cE/x91NQfGccPjWHEGnnBuhU ybb8UangiXyyWCS0eU1soQ67I+fw20VWgHJ6RX3nn2zZLMlMeaM88IjSsptpWaBURumw DRvA== X-Received: by 10.180.102.69 with SMTP id fm5mr494334wib.61.1423209339613; Thu, 05 Feb 2015 23:55:39 -0800 (PST) Received: from [192.168.2.120] (89-104-28-113.customer.bnet.at. [89.104.28.113]) by mx.google.com with ESMTPSA id bi9sm272712wib.18.2015.02.05.23.55.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Feb 2015 23:55:38 -0800 (PST) Sender: Michael Wallner Message-ID: <54D47379.8030409@php.net> Date: Fri, 06 Feb 2015 08:55:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Stanislav Malyshev , Pierre Joye CC: PHP internals References: <54D217E7.8030407@php.net> <54D2AE91.8090800@gmail.com> <54D3271E.2080207@php.net> <54D3CE01.4070903@php.net> <54D3D26A.6050405@gmail.com> <54D3D51C.8070108@php.net> <54D3D6A4.3020908@gmail.com> In-Reply-To: <54D3D6A4.3020908@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] [DISCUSSION] pecl_http From: mike@php.net (Michael Wallner) Hi Stas! On 05/02/15 21:46, Stanislav Malyshev wrote: > Hi! > >> Uhm, I'm not sure I understand :-? Weren't I supposed to measure exacly >> that? Let me know, if you wanted something else to be compared. > > I wanted to know why we need persistent resources. You brought comparing > persistent resources to reopening connection each time as an argument > that we need persistent resources. This, however, is not a good argument > for persistent resources, as the same performance improvement (or nearly > the same, discounting the closing/opening between requests - which may > be necessary anyway, see below) can be achieved without having > persistent resources, just by implementing HTTP keepalive within the > same connection object. It would also make it clearer who owns the > connection and in which state it is, right now I'm not sure what exactly > ensures the client can not end up with somebody else's connection in an > unclean state. > Are you saying performance is not the reason we use persistent handles? Stas, I really don't understand what's the issue here for you. Youself said that HTTP is a stateless protocol, so how would a connection in an "unclean state" look like in your opinion? There are just two states, alive and closed. I'm also not sure who that "somebody else" might be, whose connection I'm about to re-use? Curl caches connections the servers are fine with keeping alive, and I cache curl handles grouped by the id you pass to the client constructor and the authority of the url, that's all, nothing spooky. -- Regards, Mike