Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis Pipelining Support #21

Open
leeaaron629 opened this issue Jul 22, 2020 · 3 comments
Open

Redis Pipelining Support #21

leeaaron629 opened this issue Jul 22, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@leeaaron629
Copy link

Hi, I would like to know if Redis Pipelining will be supported in the future. This would be great for reducing network costs 👍

@gkorland
Copy link
Contributor

@onlyhope yes we plan to add support for Pipeline in the future.

@gkorland gkorland added the enhancement New feature or request label Jul 22, 2020
@lpellegr
Copy link

lpellegr commented Nov 4, 2020

I just experienced the same need. It would be a very convenient feature that avoids writing Lua scripts.

@leeaaron629
Copy link
Author

leeaaron629 commented Apr 13, 2021

@gkorland Wondering how much performance benefits I would see for bulk ingestion between the following methods:

  • TS.MADD (Sync)
  • TS.MADD (Async)
  • EVAL (LUA Script) / Pipelining

From my understanding TS.MADD is very similar to a bulk insertion with 1 network call? It can block incoming read requests if the bulk insertion is too large. TS.MADD (Async) is slightly faster because we are not waiting for a response, so we can send the next write requests without waiting. TS.EVAL is what Redis Pipeline uses under the hood? (Correct me if I am wrong here) All it does is evaluate a bunch of Redis Commands within the given script and is very similar to TS.MADD (Async).

Is the reason that Redis Pipelining is not supported because Redis Pipeline's performance is similar to a TS.MADD (Async) or a very large TS.MADD (Sync). The reason to not do a large TS.MADD (Sync) is because it can block incoming requests and there's a limit in data set size.

So if I understand correctly TS.MADD (Async) would be sufficient for bulk inserts?

EDITED:

I realized async calls are supported client-side in Lettuce, so pipelining is the way to go.

Here's a way to do it without EVAL by using Jedis API

fun pipeline(commands: Pipeline.() -> Unit) {
        jedisPool.resource.use {
            val pipe = it.pipelined()
            // sendCommand(Command.MADD, *tsdbData)
            pipe.commands()
            pipe.sync()
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants