Describe the bug The redis-benchmark SADD test does not use the random data as members. It instead uses the key values. This actually seems to provide a wrong data size output for the parameters -d and -n of the redis-benchmark. A short description of the bug.

To reproduce

Steps to reproduce the behavior and/or a minimal code sample. redis-benchmark -t sadd -c 50 -n 160000 -d 10000 -q -a redis -r 1000000000

Expected behavior This should produce about 160 000 * 10 000 Bytes of data, based on the random key space that is appended to the member of the SET right? Instead, it only generates 12779520 Bytes which is aprox. 160 000 * 12, where 12 is the key space number.

Example of how the SET looks right now:

172.17.0.2:6379> SMEMBERS myset
[...] 
159987) "element:000011482691"
159988) "element:000744988253"
159989) "element:000317027797"
159990) "element:000834365496"

A description of what you expected to happen.

Additional information

Any additional information that is relevant to the problem.

This is the current implementation

if (test_is_selected("sadd")) {
            len = redisFormatCommand(&cmd,
                "SADD myset%s element:__rand_int__",tag);
            benchmark("SADD",cmd,len);
            free(cmd);
}

Comment From: sundb

The default samples of memory usage is 5, so you can use memory usage myset samples 160000 to try again.