简体   繁体   中英

Understanding redis pipelining in lettuce

We are evaluating redis clients between jedis and lettuce. One of the feature we are looking is pipelining commands.

Behaviour in Jedis: We simply call sync on pipeline object to send all the commands to redis. The commands are batched together by client and a single request is made to redis.

How to we achieve the same in lettuce

  • Do we disable autoflush and call flush() similar to sync in jedis.
  • In autoflush is pipelining implicit. If so when does lettuce decide to do the flush of commands. Is there any configuration to tune this behaviour

Any help or references regarding is much appreciated.

You can read my answer to another question which has a bit more detail here .

but tl;dr:

The sync interface does not pipeline, but both the async and reactive interfaces do.

Auto-flushing will pipeline, but it will write commands individually to the socket. You will generally perform better if you flush manually because multiple commands are written to the socket at once.

In both cases (auto vs manual flushing) you can send multiple requests before awaiting the results

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM