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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to