-
I'm working with Lettuce as my Redis client and have some questions regarding timeout settings and their observed behavior: RedisURI Timeout vs TimeoutOptions: Could someone clarify the nuance between setting a timeout on RedisURI and using TimeoutOptions, particularly when I don't specify a particular command type? I understand RedisURI provides a general timeout setting, and TimeoutOptions offers more detailed control, but I'm not clear on how they interact or override each other. Actual Command Execution Time Exceeding Set Timeout: Despite setting timeouts both on RedisURI and via TimeoutOptions, I've noticed that the actual execution time of some commands exceeds the set timeout value. What could be the reasons for this discrepancy? Is it related to factors like network latency, server load, client-side processing, or potential misconfigurations in my setup? (In my tests using Lettuce as a Redis client, I've observed differing behaviors with regard to timeouts for GET and MGET commands. It appears that the GET command consistently adheres to the set timeout values, but MGET does not. Does this suggest that TimeoutOptions in Lettuce are applicable on a per-command basis, specifically affecting single commands differently than multi-key commands like MGET?) Any insights or experiences with similar issues would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There's a bit of history involved. Initially, we had only Timeout starts as soon as the command is dispatched into a connection. That means that a command isn't written to Redis yet when the timeout starts. On Redis Cluster, a command (such as If you have further questions, ideally provide a scenario that you want to understand better and please provide some code/some arrangement so that we talk the same things. |
Beta Was this translation helpful? Give feedback.
There's a bit of history involved. Initially, we had only
RedisURI.timeout
that was applied in some places (connect timeout, command timeout through the synchronous API but not the async API).TimeoutOptions
defines a full set of how to determine a timeout.TimeoutOptions
can either apply the command timeout that is set onRedisURI
or you can specify a customTimeoutSource
to control timeouts for individual commands.Timeout starts as soon as the command is dispatched into a connection. That means that a command isn't written to Redis yet when the timeout starts.
On Redis Cluster, a command (such as
MGET
) is partitioned across hash-slots and Lettuce sends multipleMGET
commands with slice…