redis-py icon indicating copy to clipboard operation
redis-py copied to clipboard

Using redis-py to access a redis-cluster is so slowly

Open hert525 opened this issue 3 years ago • 5 comments

Using redis-py to access a redis-cluster set with a key of more than 100m takes 6s, which is too slow. How can I optimize it, but when I use the same environment to access a standalone, it is very fast

hert525 avatar Sep 07 '22 03:09 hert525

This is because the key needs to be hashed before being sent to the correct node. It would be helped a little by #2118, but the amount of time would still be directly proportional to the length of the key. You could try using hashtags in your keys (keep it near the start): https://redis.io/docs/reference/cluster-spec/#hash-tags.

utkarshgupta137 avatar Sep 07 '22 05:09 utkarshgupta137

This is because the key needs to be hashed before being sent to the correct node. It would be helped a little by #2118, but the amount of time would still be directly proportional to the length of the key. You could try using hashtags in your keys (keep it near the start): https://redis.io/docs/reference/cluster-spec/#hash-tags.

Sorry, I didn't describe clearly ,Not the key exceeds 100m, is the value over 100m

hert525 avatar Sep 14 '22 01:09 hert525

Can you share a sample code to illustrate the performance difference?

utkarshgupta137 avatar Sep 14 '22 09:09 utkarshgupta137

image tks

hert525 avatar Sep 15 '22 02:09 hert525

Can you share a sample code to illustrate the performance difference?

hi

hert525 avatar Sep 19 '22 02:09 hert525

This issue is marked stale. It will be closed in 30 days if it is not updated.

github-actions[bot] avatar Sep 20 '23 00:09 github-actions[bot]