twemproxy icon indicating copy to clipboard operation
twemproxy copied to clipboard

add slowlog feature

Open kukey opened this issue 4 years ago • 2 comments

Problem: Sometimes we need to check what response was slowly, but tweproxy now only support log(every request), it`s very inconvenient.

Solution: Provide slowlog command like redis slowlog command and return. I have implemented the redis part , like this:

微信图片_20210921130811

I`ll sort my code and send it out!

kukey avatar Sep 21 '21 05:09 kukey

  1. I don't think this is within the scope of the project and don't plan to add it
  2. The redis slowlog feature is the time take on the server - the time taken on the client will vary widely for reasons outside the control of twemproxy, such as network packet loss causing delays (not applicable within the server's own counting, that's counting just time to process the request, compute/encode the response), high cpu load in unrelated programs causing delays, etc., and may be inactionable.
  3. Twemproxy's logging is disabled at verbose level at compile time by default (see ./configure --enable-debug=..., and is skipped based on the nutcracker -v $level option. This would add additional time to processing each request for a feature that would be used pretty rarely and have the drawbacks in 2.

TysonAndre avatar Sep 21 '21 14:09 TysonAndre

1 and 2, I do not think so. This feature is used for Judge whether the reason is from client to proxy or proxy to server when causing delays. 3. yeap, but it is for every request. Sometime we only care about a certain range of timeout request.

kukey avatar Sep 22 '21 05:09 kukey