How does RedisCluster pick from connections from connection pool? #2457
-
We have a PHP config
Client initialized like: // single seeds, point to "dedicated configuration
$client = new RedisCluster(null, ['....amazonaws.com:6379'], 0.1, 0.3, true); When fetching random keys we consistently notice this pattern of decreasing time taken:
When doing random concurrent testing (with these 6 fetch ops), PHP has 8 processes (unique PIDs), and Question: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The only way to be sure would be to do low level profiling that could capture granular samples of which part of the operation takes what amount of time. If I'm just speculating my assumption is that it just comes down to network idiosyncrasies and that the connections become slightly faster after they've just been used. That said, I'm basically ignorant to the details around ElastiCache as I have only ever used it in a debug environment to help people with issues now and again. Pulling the persistent connection from the pool is likely a nanosecond/microsecond level operation. It's a tiny hash table mapped to a (in your case) single element linked list. Another thing you could try is testing latency to the various redis nodes just via the command-line, to see if you see a similar warming up after repeated operations. |
Beta Was this translation helpful? Give feedback.
The only way to be sure would be to do low level profiling that could capture granular samples of which part of the operation takes what amount of time.
If I'm just speculating my assumption is that it just comes down to network idiosyncrasies and that the connections become slightly faster after they've just been used.
That said, I'm basically ignorant to the details around ElastiCache as I have only ever used it in a debug environment to help people with issues now and again.
Pulling the persistent connection from the pool is likely a nanosecond/microsecond level operation. It's a tiny hash table mapped to a (in your case) single element linked list.
Another thing you could try is testi…