Replies: 2 comments 4 replies
-
|
Hi @proost, Thank you for the proposal. The two waiting counters and their implementation look good to me. However, I am afraid that these two metrics can't help us improve latencies. Latencies depend on how fast we flush the output buffer and how fast we deliver responses back. In other words, I think we should probably monitor _backgroundWrite() and _backgroundRead(), not the ring. |
Beta Was this translation helpful? Give feedback.
4 replies
-
|
Close due to lack of usage ring buffer stats |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Adding ring buffer monitoring stats method. ring buffer monitoring helps to find debugging increasing latency and resource sweet spot.
Problem Definition
Background
rueidisis queuing redis commands to use connections effectively and efficiently with high throughput. But sometime commands queue can be bottleneck of latency. Although rueidis supportsRingScaleEachConnandPipelineMultiplexoptions to tune commands queue, it is not easy to find sweet spot. Because it is hard to monitor commands queue.Goal
High Level Plan
Queue
We should add returning queue stats function.
commandQueueStatshas state of queue. UsingcommandQueueStats, we can monitorqueueWire
We should add returning queue stats function.
wirereturns own queue stats to callqueue.Statsconn
conncan have multiplewires. So we have to supports how manywirehas and sum ofwaitingForWriteCommandsCountand sum ofwaitingForResultCommandsCount. Using 3 fields, we can deduce average ofwaitingForWriteCommandsCountand average ofwaitingForResultCommandsCount.Client
We define new interface
ClientStatsProvider.ClientStatsProviderreturnsStatsof client.We can’t add
Stats()method toClientdirectly. Because adding new method can be breaking change to some implementations ofClientinterface .Detailed Plan
ring
ringstruct has two fieldswaitingForWriteCount,waitingForResultCountwaitingForWriteCountincrease by one when before returningPutOne,PutMulti.waitingForWriteCountdecrease by one whenn.markequals 1 inNextWriteCmd, before returningWaitForWrite.waitingForResultCountincrease by one whenn.markequals 1 inNextWriteCmd, before returningWaitForWrite.waitingForResultCountdecrease by one whenn.markequals 2 inNextResultCh.above operations must be atomic.
Also, we should support
Statsmethod.pipe
mux
singleClient
sentinelClient
clusterClient
How to use stats?
I expect that
Stats()is called periodically in loop which is made by user.Beta Was this translation helpful? Give feedback.
All reactions