Unverified Commit ddd43b6b authored by gourav's avatar gourav Committed by GitHub
Browse files

Randomize the random number generator's seed used in redis-benchmark (#8174)

The pid of the benchmark process is used to randomize the random number generator's
seed. This ensures that when multiple benchmark processes are started at the same time
to generate load on a server, they use different seeds. This will ensure randomness in
the keys generated by different benchmark processes.
parent feba7cbf
......@@ -1676,7 +1676,7 @@ int main(int argc, const char **argv) {
client c;
srandom(time(NULL));
srandom(time(NULL) ^ getpid());
signal(SIGHUP, SIG_IGN);
signal(SIGPIPE, SIG_IGN);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment