We have big traffic between clients and redis server, most because of passing keys as strings (we pass uuid). Sending byte[] through pipeline will help.
Also add some way to specify shard (choosing shard with regexp on highload is too bad). Smth like:
We have big traffic between clients and redis server, most because of passing keys as strings (we pass uuid). Sending byte[] through pipeline will help.
Also add some way to specify shard (choosing shard with regexp on highload is too bad). Smth like:
ShardedJedisPipeline pipelined = resource.pipelined();
String uuid1 = ...; byte[] key1 = uuid1.toByteArray(); String uuid2 = ...; byte[] key2 = uuid1.toByteArray(); Response res1 = pipelined.get( key1, calcShardIdxFor(uuid1) );
Response res2 = pipelined.get( key2, calcShardIdxFor(uuid2) );
...
public statis int calcShardIdxFor(String shardKey) { return HashUtils.getHash(shardKey) % SHARDS_COUNT; }