-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change session_lock default ini values #350
Change session_lock default ini values #350
Conversation
I'd like to do some detective work to understand why the defaults were changed for 3.0 and if it makes sense to change them back. Thank you for taking the discussion in #269 and suggesting specific changes to address the problem reported there. |
Note that we are running a high traffic (~140 cmd/s) site in production with these settings (we use both sessions and user cache) without any issues so far. We use PHP 7.1. |
It would be most interesting to learn the rationale behind changing the default values, as it seems it is the source of quite some problems. From what I can see, the original values ( ; Session spin lock retry wait time in microseconds.
; Be carefull when setting this value.
; Valid values are integers, where 0 is interpreted as
; the default value. Negative values result in a reduces
; locking to a try lock.
; the default is 150000
memcached.sess_lock_wait = 150000
; The maximum time, in seconds, to wait for a session lock
; before timing out.
; Setting to 0 results in default behavior, which is to
; use max_execution_time.
memcached.sess_lock_max_wait = 0;
; The time, in seconds, before a lock should release itself.
; Setting to 0 results in the default behaviour, which is to
; use the memcached.sess_lock_max_wait setting. If that is
; also 0, max_execution_time will be used.
memcached.sess_lock_expire = 0; |
Thanks for taking the time to present a new set of default values that may work better for most people. I will accept this PR, but I merged a cleanup PR ahead of this one that comments-out any default INI values that were explicitly set to the default values. Could you update this PR to reflect the new default values, but retain the commented-out status of the INI directives? |
@sodabrew I updated the PR But, ... I also think we can improve the code even more. I'll make a new PR for: Suggestion 1 (my preference): because nobody knows why the exponential backoff was added, I suggest we remove it and restore the original behavior. Suggestion 2: change the default value of My guess is that nobody uses it. So removing it seems the best solution. We can always add it again later when it becomes clear why it was added. What do you think? |
Regarding the exponential backoff, that type of algorithm is generally only useful if it is random exponential backoff, so that two requests that begin at exactly the same time will de-conflict after a few tries. |
@sodabrew so, what's next? |
@sodabrew I think the best course of action would be to revert revert back to the old retry algorithm (#355). If reverting to the old retry algorithm takes too much time to make it into the next release, I would suggest reverting back to the 'old' default values (this pull request) as an intermediate quickix. |
Hi @tvlooy I've been waylaid on this project by other work I have going on right now, but I haven't forgotten and will make every effort to merge together the sensible defaults that have been proposed in PR and to cut a release. |
Hi all, I had tried this configure for the version 3.0.3, But casued anthor issue, the php slow log tracked Or it can the server's response? I used a test server, maybe the configuration is too small to handle the frequent request?
memcached configuration:
updateAfter full tests for our whole application, there also accoured |
@sodabrew is this PR critical enough to block a release of 3.1.0 (given no updates since November '17 and being carried over for the three milestones already)? |
I am still running fine with these settings by the way. This issue is open near to a year now. You lost me ... sorry |
Sold. Will cut a release soon's I can. |
Is the comment about |
@michaelbutler yes. |
The old extension had these values as a default. I don't know why this changed, the commit messages don't explain it. People are having issues with it #269 changing the values seems to help.
The max_retries was calculated but defaulted to max_execution_time when it was 0. I chose 30s as the default max_execution_time because this is the default in PHP.
ping @mkoppanen