Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82183 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67823 invoked from network); 8 Feb 2015 22:25:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2015 22:25:51 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.49 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.49 mail-pa0-f49.google.com Received: from [209.85.220.49] ([209.85.220.49:34857] helo=mail-pa0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 22/08-26926-E62E7D45 for ; Sun, 08 Feb 2015 17:25:50 -0500 Received: by mail-pa0-f49.google.com with SMTP id fb1so14471360pad.8 for ; Sun, 08 Feb 2015 14:25:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=tdXnPFyEueOzIjDvp/h4JYct7rMyEvMR//ifJKDU/H0=; b=rWSFrq1ru7qYJjLFpwPKE6blUB2Bvm4fl1hsYuyRBT2piutPvlWievEOaZxNEa3L8n bkq4eajBucwNEy6foDl/c7NvG3rUdJQ7W076mce2B1LFn06Tub+NhIFJrKn6F8FM/uQh xYndkqt1gM0oVqMCaFF9u502FzFdln4bUw+FXtGEBHTCOc1/4FBYHIowaGEVxUnS7RkA I+YB2HdvjAGmM1U9g2cV4Byvvp+z/76eNaH4sCKnJAQYX+8IvtNajXIrpGpyFAn//0nV 8xd+5Va6ydemD9iWYKqZXgKo1T2thUPHUosdDZEJeeq+oOArCdUZGLipZz1//v1PwNrw npPw== X-Received: by 10.66.55.104 with SMTP id r8mr23035181pap.75.1423434347642; Sun, 08 Feb 2015 14:25:47 -0800 (PST) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id mb6sm14319010pdb.33.2015.02.08.14.25.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Feb 2015 14:25:46 -0800 (PST) Message-ID: <54D7E259.4090702@gmail.com> Date: Sun, 08 Feb 2015 14:25:29 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Michael Wallner , 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> <54D47379.8030409@php.net> In-Reply-To: <54D47379.8030409@php.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] [DISCUSSION] pecl_http From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Are you saying performance is not the reason we use persistent handles? It is, for databases where connection setup is expensive. Even then persistent handles are not always the best solution. But with DB, you routinely connect to one service, with one set of credentials, and need this connection constantly. With HTTP, it is rarely the case that you want to maintain the connection to the same service for an extended time (like hours or even days). > Stas, I really don't understand what's the issue here for you. The issue is that I think maintaining long-time persistent HTTP connections (I do not mean keepalive connection that serves a number of requests within the context of one workload, like browser does) is not a good idea, in fact it looks suspiciously like a DOS since many HTTP servers, including Apache, are not equipped properly to handle such model. While there may be corner cases where it may be useful, encouraging the practice looks like a mistake to me. > Youself said that HTTP is a stateless protocol, so how would a > connection in an "unclean state" look like in your opinion? Connection and protocol are different things. In connection, you could be in the middle of the protocol - i.e. sending headers, sending body, receiving headers, receiving body - and these are different states. > 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. Caching connections within the same request and reusing them is not spooky, but caching them long term, across requests, across security domains, for extended time - is spooky. -- Stas Malyshev smalyshev@gmail.com