-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
recommend enableAutoPipelining? #257
Comments
Likely so |
would this just be a documentation update? Seeing as option is available in ioredis https://github.com/luin/ioredis/blob/main/lib/redis/RedisOptions.ts#L136 |
I dont think this is a documentation only task. I assume that for really using autoPipelining, we have to replace the manually set pipelines with a lua script. Something like Then I think we can make use of autoPipelining. |
If we enable autopipelining we can just remove those two pipeline commands. |
Sure, but what if the implementator does not use ioredis but node-redis or something like that. In the readme.md we say, that we recommend ioredis, but other redis clients are also possible. And if they dont implement autopipelining then we have a broken solution. |
Auto-pipelining meaning they will I don't think how the impact was, maybe it will increase |
Probably using lua improves the perforrmance. It would also mean that we dont need to pipeline in our redis store. It is then optional to use auto pipelining or not. |
This is incorrect. In fact, it will execute ops sooner because they will be batched with previous ops. In my experience using Lua does not improve things in similar cases. The cost here is driven by head-of-line blocking. |
I am not sure about this statement, when I look through the code of When it do not use
|
I invented that tecnique, watch the video: https://m.youtube.com/watch?v=0L0ER4pZbX4. Only one command could be in flight on a socket connected to Redis. Without autopipelining, all commands are queued and run in order. With autopipelining:
This mitigate head of line blocking in Redis. Considering 100 commands and 10ms RTT this will give a save of 990ms waiting time. |
I guess we can check if the redis option is of ioredis instance and if so check if autoPipeline is enabled. I so use without pipeline() if autoPipelin is true. |
https://github.com/redis/node-redis#auto-pipelining I'm not sure what we should do here, I honestly don't know which one is better, or if that's a wrong way to look at it, which one is Redis Ltd's preferred/main package for node |
The problem is, that we cant use autoPipelining, because our redis store is creating a pipeline for each call. So autoPipelining wont pipeline that again. I think we have to create a custom command in redis, which does the incr and pttl call, so we dont use pipeline anymore and autoPipeline takes effect. |
Just an update here, the final status of this is that since we now do 1 command per request with lua, autoPipelining didn't improve the performance We'd talked about it with @Uzlopak at some point, but I don't know where it was |
Prerequisites
Issue
I wonder if we get some performance benefit if we recommend enableAutoPipelining?
The text was updated successfully, but these errors were encountered: