Tracing Lettuce, Command Duration - What does it really measure? #2981
Replies: 1 comment
-
Hope this late answer will help. There are quite some unknowns about your deployment for me to answer with confidence. Each of these public class CommandHandler extends ChannelDuplexHandler implements HasQueuedCommands {
...
private void attachTracing(ChannelHandlerContext ctx, RedisCommand<?, ?, ?> command) {
... ... and then ends when the response is received by the driver ... public class BraveTracing implements Tracing {
...
@Override
public BraveSpan start(RedisCommand<?, ?, ?> command) {
span.name(command.getType().toString());
...
if (command instanceof CompleteableCommand) {
...
span.finish();
});
} else {
throw new IllegalArgumentException("Command " + command
+ " must implement CompleteableCommand to attach Span completion to command completion");
}
span.start();
this.tracingOptions.customizeSpan(command, span);
return this;
}
... ... depending on the type of the command and the settings for tracing. On your questions, specifically:
Not sure of your architecture. Assuming the client is where the Lettuce driver is used and the server is where the Redis server is deployed, then yes.
Probably not.
Probably yes. Lettuce makes RESP (RESP2 or RESP3) requests to Redis servers. The calculated time includes the time needed for the Redis server to process and respond to the MGET command. Querying other databases is not calculated. Only the time that was spend getting a response from Redis.
If the application uses Lettuce to handle the request, then yes. Does that help? |
Beta Was this translation helpful? Give feedback.
-
I didn't find any reference explaining exactly what the duration specified in the trace, really indicates. I'm trying to analyze some slow http requests, and I see some MGET redis requests taking even 750 ms to run. But what this duration includes? This is what I suppose it includes:
Network Latency: Time for the request to travel from the client to the server and back.
Server Processing Time: Time taken by the server to process the request (in this case, the /assets/discover endpoint).
Database or Cache Access Time: If the operation involves querying a database or a cache (e.g., Redis), the time spent on these operations is also included.
Application Logic: Any time taken by the application in handling the request, like reading from the socket and deserialize the response.
I'm not sure about the last one. But what I like to know is, if I can exclude at least latencies coming from the app. So I can be sure the app is not the problem. Otherwise the trace is not helping much. Too many variables to consider.
Beta Was this translation helpful? Give feedback.
All reactions