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
Should timeout
be read_timeout
?
#795
Comments
Hey, Right so the "timeout" setting in the context of cluster refers to how long you are willing to let phpredis attempt to get your data before it returns execution to you. Timeouts are pretty simple on a single instance as you can just use something like a connection timeout (how long to wait for a connection), and a read timeout (how long to wait to read a response). If you're using a cluster, however, it gets more complicated. The cluster could be resharding, or failing over, etc. A way to describe it is "how long should phpredis let the cluster bounce us around before failing". It's different than a standard socket timeout, in that there may never be any TCP/IP communication error, but we still want to time out. The reason for this is so it doesn't just wait an infinite amount of time while it could be getting Does that make sense? Cheers, |
Thanks for the fast response Michael. We are using Redis cluster, so I do understand the logic is more complicated. Your description does clearly define the differences. However, I'm still confused why the code is using the |
Hey What's more, I found the condition set on the line : Line 1436 in 31b0531
makes the client has no chance to retry after it received MOVED, when the connect timeout happened in CLUSTER_LAZY_CONNECT. Would you please give us more clarity information? |
redis_cluster_init {
... cluster_send_command { |
Old issue without any activity for a long time |
When a node timeout occurs, then phpredis will try to connect to another node, whose answer probably will be MOVED redirect. After this we need more time to accomplish the redirection, otherwise we get "Timed out attempting to find data in the correct node" error message. Fixes phpredis#795 phpredis#888 phpredis#1142 phpredis#1385 phpredis#1633 phpredis#1707 phpredis#1811 phpredis#2407
When a node timeout occurs, then phpredis will try to connect to another node, whose answer probably will be MOVED redirect. After this we need more time to accomplish the redirection, otherwise we get "Timed out attempting to find data in the correct node" error message. Fixes #795 #888 #1142 #1385 #1633 #1707 #1811 #2407
We are trying to understand the difference between the
timeout
andread_timeout
. We noticed thatc->waitms
is set totimeout
instead ofread_timeout
on this line:phpredis/cluster_library.c
Line 818 in 31b0531
We recently reduced timeout from 5 seconds to 1 second. Now we are seeing a significant number of "Timed out attempting to find data in the correct node!" errors and would have assumed it was tied to
read_timeout
, but it's actually tied totimeout
. Istimeout
the correct value to be set forc->waitms
?Our current production settings have:
Any advice on the appropriate next steps would be appreciated.
The text was updated successfully, but these errors were encountered: