skip to Main Content

I have a system of multiple machines, each running a redis server which contains unique objects. A remote client can access each of these servers and read the objects.

I’m wondering to how to measure the latency of a remote read? Can I use Jedis to do it?

2

Answers


  1. One of the tool you usually get when you install Redis, is redis-benchmark.
    Running a very simple test e.g. redis-benchmark -n 100000 will get you a very detailed report on the latency.

    Here is a snippet of such a report:

    $ redis-benchmark -n 100000
    
    ====== SET ======
      100007 requests completed in 0.88 seconds
      50 parallel clients
      3 bytes payload
      keep alive: 1
    
    58.50% <= 0 milliseconds
    99.17% <= 1 milliseconds
    99.58% <= 2 milliseconds
    99.85% <= 3 milliseconds
    99.90% <= 6 milliseconds
    100.00% <= 9 milliseconds
    114293.71 requests per second
    
    Login or Signup to reply.
  2. Since I’m interested in the latency of each and every read, I have found SLOWLOG to be useful:
    https://redis.io/commands/slowlog

    It contains the timestamp and the time it took to process the command.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search