We're planning on monitor REDIS protocol communication with packetbeat. What we want from packetbeat is to decode and record REDIS commands between server and clients.
The test environment is somewhat like this:
- Redis Server: VM with 4vCPU and 8g RAM
- Redis Client for benchmark: my notebook ...
- Redis version: 4.0.6, with default config
The packetbeat is running on the redis server, sniffing the interface redis server listens on. The output is set to local file.
We've tested with redis-benchmark and redis-cli.
- With redis-benchmark
We only test redis command LPUSH, push 100K strings onto redis server. All pushes are successful. When redis-benchmark finished, length of key "mylist" is exactly 100K. As shown in the result of redis-benchmark, the command execution throughput is around 50K to 60K per second.
Sadly, in the output file of packetbeat, we only found around 40K to 50K of LPUSH commands, which means around 50% to 60% packet loss. The log of packetbeat itself show "redis.unmatched_response" and "tcp_dropped_because_of_gaps", however these numbers still didn't add up.
We've further tested with redis-benchmark while setting "keepalive off", the packet loss was even greater.
- With redis-cli
After the tests with redis-benchmark, we've tried redis-cli for the testing as it can set the interval between each command, so that we might manually control the speed of REDIS commands.
We've tested with:
interval set from 0.1s to 0.01s, 5K commands (LPUSH) each test run , packetbeat show no loss. However, the throughput of REDIS commands is "quite" poor.
interval set to 0.0s, 10K commands (LPUSH), packetbeast show about 2% loss. The speed is around 1K/s.
As of now, I don't have the first-hand result of those tests, but if anyone is interested, later I may run these tests again and update with some exact numbers.