Replies: 1 comment 1 reply
-
Nothing comes for free. Expiring a task requires scheduling of a task that completes the command with an exception. Happy to accept a pull request that improves performance behavior. The expiration timeout begins with the command invocation before the command is sent to the server. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @mp911de, while doing performance tests on Lettuce (using one single shared connection), I found from the frame graph of client thread that the
io.lettuce.core.protocol.CommandExpiryWriter#potentiallyExpire
method consumes a relatively large portion of time (about 8%). It seems that it's caused by the context switch incurred when we add the command expiring task to theLinkedBlockingQueue
ofDefaultEventExecutor
. If I simply set the timeout to zero onRedisClient
to disable the expiring task, I will get a performance gain of about 30% (from 65k ops to 85k ops). So I think maybe we could try using some other command expiring approaches, perhaps aHashedWheelTimer
, instead of theLinkedBlockingQueue
, to see if it will bring some positive impact on performance :)Beta Was this translation helpful? Give feedback.
All reactions