I have been using redis stand alone for many years now. Since now the requirement is that all software must be clustered to make it highly-available I am evaluating redis-cluster.
When I try a simple rpush on a single redis key , the cluster takes 5x more the time for rpush as compared to a standalone instance
Is there something I should be doing to improve the performance of the cluster. The redis server version is 3.2.3
The code is below ( php)
<?php
$redis_standalone = new Redis();
$redis_standalone->connect("localhost");
$redis_standalone->del("JOBS_QUEUE");
echo time()."\n";
for($i=0;$i<100000;$i++){
$redis_standalone->rpush("JOBS_QUEUE",$i);
}
echo time()."\n";
?>
And for the cluster
<?php
$redis_cluster = new RedisCluster('myclustername', ['127.0.0.1:7000','192.168.50.166:7001','192.168.50.167:7000','192.168.50.168:7000','192.168.50.169:7000','192.168.50.171:7000']);
$redis_cluster->del("JOBS_QUEUE");
echo time()."\n";
for($i=0;$i<100000;$i++){
$redis_cluster->rpush("JOBS_QUEUE",$i);
}
echo time()."\n";
?>