1

I use redis-py to operate on redis, and our environment use twemproxy as redis proxy. But looks clinet pipeline doesn't work when connect to twemproxy.

import redis

client = redis.StrictRedis(host=host, port=port, db=0)
pipe = client.pipeline()
pipe.smembers('key')
print pipe.execute()

it throws exception when do execute method

redis.exceptions.ConnectionError: Socket closed on remote end

In twemproxy environment, client pipeline doesn't work or it is an issue of redis-py ?

linbo
  • 2,393
  • 3
  • 22
  • 45

2 Answers2

2

Becouse of twemproxy supports not all redis commands.

Here is actual supported commands list https://github.com/twitter/twemproxy/blob/master/src/proto/nc_redis.c

Nick Bondarenko
  • 6,211
  • 4
  • 35
  • 56
1

redis-py pipeline will use transaction by default, try this:

pipe = r.pipeline(transaction=False)
ning
  • 101
  • 1
  • 2