Re: Re: Revert session_serializer_name(), session_gc()

From: Date: Sun, 16 Mar 2014 00:57:51 +0000
Subject: Re: Re: Revert session_serializer_name(), session_gc()
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi Andrey,

On Sun, Mar 16, 2014 at 9:45 AM, Yasuo Ohgaki <[email protected]> wrote:

> On Sun, Mar 16, 2014 at 3:33 AM, Andrey Andreev <[email protected]> wrote:
>
>> >> > "write short circuit" omits "write" when $_SESSION
>> >> > hasn't change.
>> There
>> >> > is
>> >> > no point calling write API and writing to storage for the same data.
>> >>
>> >> "write short circuit" as I understand it, is an exact copy of the
>> >> 'lazy_write' option. This will be addressed in the previously
>> >> mentioned RFC that I'll post later today.
>> >
>> >
>> > No. It's not.
>> >
>> > "lazy_write" does not lock session data while "write short
>> > circuit"
>> does.
>> > In other words, "lazy_write" changes session behavior, but "write short
>> > circuit" does not.
>> > i.e. With locked session data, "write short circuit" would not change
>> how
>> > session manager works.
>>
>> I can't stress enough how confusing and potentially unsafe that is
>
>
> It does not make difference since many users use session_commit()
> to get more concurrency already. Simple documentation would be enough to
> understand what it does.
>
> There are freedom to shoot their own foot by themselves in any languages.
> We have better performance/more complex operations/convenience in return.
>

One more comment for this.

"write short cut" is designed to work with old(I mean existing) save
handlers.
Behavior does _not_ change at all. New save handlers that support new save
handler API work much faster. That's it.

Save handlers like memcahe/memcached updates last access time stamp
by reading data. These save handler may omit writes at all when session data
hasn't changed. I don't think explanation is needed why this gives us better
performance.

Regards,

--
Yasuo Ohgaki
[email protected]


Thread (41 messages)

« previous php.internals (#73184) next »