Hi all,
Following patch against master
https://gist.github.com/yohgaki/6198611
implements FR #17860
https://bugs.php.net/bug.php?id=17860
This patch removes unneeded session writes. i.e. session data
has not changed, just skip write and improve performance.
Although it is safe to remove unneeded writes, if many of us
want ini setting for enable/disable write short cut, I'll add setting
for it.
Any comments?
P.S. Not all of tests are fixed yet.
--
Yasuo Ohgaki
yohgaki@ohgaki.net
This patch removes unneeded session writes. i.e. session data
has not changed, just skip write and improve performance.Although it is safe to remove unneeded writes, if many of us
want ini setting for enable/disable write short cut, I'll add setting
for it.Any comments?
How does this affect GC of sessions? If a session is not written for 30
minutes, but the user is active, is there a potential for their session to
be GC and destroyed?
Hi Leigh,
How does this affect GC of sessions? If a session is not written for 30
minutes, but the user is active, is there a potential for their session to
be GC and destroyed?
Thank you for heads up.
I'll make it optional and document the side effect.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi Leigh,
How does this affect GC of sessions? If a session is not written for 30
minutes, but the user is active, is there a potential for their session to
be GC and destroyed?Thank you for heads up.
I'll make it optional and document the side effect.
What is the performance difference if you just touch the files instead of
writing them? (i.e. update mtime)
Hi Leigh,
What is the performance difference if you just touch the files instead of
writing them? (i.e. update mtime)
It will be faster for sure for files and database/network
based session storage, but I didn't took benchmark.
I can make default handlers not to purge data, but
3rd party save handlers will be affected. Since there
is no API for it. Should I create API?
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi Leigh,
What is the performance difference if you just touch the files instead
of writing them? (i.e. update mtime)It will be faster for sure for files and database/network
based session storage, but I didn't took benchmark.I can make default handlers not to purge data, but
3rd party save handlers will be affected. Since there
is no API for it. Should I create API?
I think custom handlers should still function as they always did, you
should not track whether the session changed or not for them, they can
easily track that themselves.
For the built-in file based handler, do you think it would be a valid
compromise to update the mtime of session files instead of not writing to
them at all? This way you do not break BC, and maybe get a performance
increase too. (and can be on by default)
Disabling writes altogether (even optionally) with documented hard to debug
unexpected side effects isn't a good thing in my opinion.
Hi Leigh,
I think custom handlers should still function as they always did, you
should not track whether the session changed or not for them, they can
easily track that themselves.For the built-in file based handler, do you think it would be a valid
compromise to update the mtime of session files instead of not writing to
them at all? This way you do not break BC, and maybe get a performance
increase too. (and can be on by default)Disabling writes altogether (even optionally) with documented hard to
debug unexpected side effects isn't a good thing in my opinion.
I agree.
Let it handle save handlers. I'll create a API for touching session data,
if save handler does have the API, operate
session as it is now. If save handlers implement touch API properly, we get
performance gain and no headaches.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi all,
How does this affect GC of sessions? If a session is not written for 30
minutes, but the user is active, is there a potential for their session to
be GC and destroyed?Thank you for heads up.
I'll make it optional and document the side effect.
Anyone has good name for the option?
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi all,
Anyone has good name for the option?
I'll create a API that touches session data.
If API is not implemented by save handler, then it works as it is now.
Therefore, no ini setting is needed.
My apology for the noise.
--
Yasuo Ohgaki
yohgaki@ohgaki.net