Describe the bug This is a small bug that can be easily reproduced by using redis-benchmark with a pipeline number larger than 1.
Bottom line we're issuing more requests to the server than expected (meaning we're not enforcing upper bound to number of requests) and this can be easily address by changing atomicGetIncr(config.requests_issued, requests_issued, 1); by atomicGetIncr(config.requests_issued, requests_issued, config.pipeline);
I caught this issue while adding tests for redis-benchmark as per #7947 discussion. Additionally that same PR fixes this issue and includes tests to keep this bug from happening again.
To reproduce
$ ./src/redis-benchmark -P 10 -c 5 -n 1000 -t set
====== SET ======
1000 requests completed in 0.00 seconds
5 parallel clients
3 bytes payload
keep alive: 1
host configuration "save": 3600 1 300 100 60 10000
host configuration "appendonly": no
multi-thread: no
Latency by percentile distribution:
0.000% <= 0.047 milliseconds (cumulative count 20)
50.000% <= 0.111 milliseconds (cumulative count 560)
75.000% <= 0.143 milliseconds (cumulative count 760)
87.500% <= 0.183 milliseconds (cumulative count 880)
93.750% <= 0.231 milliseconds (cumulative count 950)
96.875% <= 0.903 milliseconds (cumulative count 970)
98.438% <= 0.935 milliseconds (cumulative count 990)
99.219% <= 0.943 milliseconds (cumulative count 1000)
100.000% <= 0.943 milliseconds (cumulative count 1000)
Cumulative distribution of latencies:
46.000% <= 0.103 milliseconds (cumulative count 460)
92.000% <= 0.207 milliseconds (cumulative count 920)
95.000% <= 0.303 milliseconds (cumulative count 950)
97.000% <= 0.903 milliseconds (cumulative count 970)
100.000% <= 1.007 milliseconds (cumulative count 1000)
Summary:
throughput summary: 333333.34 requests per second
latency summary (msec):
avg min p50 p95 p99 max
0.150 0.040 0.111 0.231 0.935 0.943
commandstats output ( expected 1000 set commands and we can notice 1040 )
$ redis-cli info commandstats
# Commandstats
cmdstat_config:calls=3,usec=58,usec_per_call=19.33
cmdstat_set:calls=1040,usec=371,usec_per_call=0.36
Expected behavior
The clause enforcing upper bound to number of requests to work for both pipeline and non pipelined commands.