我正在尝试使用管道在我的Redis上执行MGET操作,以提高性能。 我尝试过一次完成MGET,也尝试过批量流程
from rediscluster import RedisCluster
ru = RedisCluster(startup_nodes=[{"host": "somecache.aws.com", "port": "7845"}],
decode_responses=True,
skip_full_coverage_check=True)
pipe = ru.pipeline()
# pipe.mget(keys)
for i in range(0, len(keys), batch_size):
temp_list = keys[i:i + batch_size]
pipe.mget(temp_list)
resp = pipe.execute()
到目前为止,我得到的错误
raise RedisClusterException("ERROR: Calling pipelined function {0} is blocked
when running redis in cluster mode...".format(func.__name__))
rediscluster.exceptions.RedisClusterException: ERROR:
Calling pipelined function mget is blocked when running redis in cluster mode...
我想知道的是
事实证明,我们不能将MGET用于管道,下面是m的最终解决方案
相关问题 更多 >
编程相关推荐