-
Notifications
You must be signed in to change notification settings - Fork 326
memcached.sess_persistent not working with memcached.sess_binary_protocol = On #375
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
Comments
Interesting! I haven't seen this locally. I will try to reproduce. In the mean time, can you run locally with tcpdump while you're testing and post the output? This should do it:
|
On Wed, Jan 17, 2018 at 04:47:52AM +0000, Aaron Stone wrote:
Interesting! I haven't seen this locally. I will try to reproduce. In
the mean time, can you run locally with tcpdump while you're testing
and post the output? This should do it:
```
tcpdump -i eth0 -s 65535 -A port 11211
```
Sure here it is, a new connection created for each request:
... [ edited to repost with block code ticks below ] ...
…--
Valentin
|
Thank you!! Due to a limitation in GitHub ("email replies do not support markdown") I'm reposting the contents of your message:
|
Ok, so just confirming what you found in code, that the reconnect is initiated by the client and not because the server is responding in an unexpected way. Your suggestion to check the current state of the binary protocol flag on the persistent connection makes sense. |
Before:
After #379:
|
Looking at the lsof listing of the apache2 process the port number changes after every request to that process:
so the persistence is not working as expected since the old TCP connection is dropped and a new one created for each PHP request being handled.
Setting memcached.sess_binary_protocol = Off fixes the problem and the TCP connections are retained between requests.
The problem seems to be that setting the binary protocol kills existing connections:
Since setting some options closes the existing connection the solution might be to first get the current behavior with memcached_behavior_get and only call memcached_behavior_set if the value is not as expected?
The text was updated successfully, but these errors were encountered: