-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
auth/select of connection reuse issue #41
Comments
This is example code: |
I'm not sure I understand your problem. You want to avoid sending So basically no, that's not a good idea. If you want to reuse a redis connection in various places, you are free to do this within the bounds of a single request. You cannot share connections across requests in a safe way. |
Sorry, let me restate my issue, I think the reused pool connection should not be execute to I have a scene. 10k requests, execute to How do you think? Thankes. |
Well, firstly, have you measured how much time I think connections obtained from the keepalive pool need to behave just as if they are fresh connections. Like I said, they are intended as reused TCP connections, not stateful clients, since the keepalive mechanism works at a lower level and is shared across all TCP connections on the worker. However, your question raises an important concern because you're quite right, that's not how it works right now. If we send Whilst I appreciate this is exactly what you're asking for, it's actually pretty bad I think. I think
One approach I considered was to use the So right now I'm thinking @hamishforbes @piotrp any thoughts on this? @snpcp Sorry, I realise this isn't what you were hoping for! If you really have a measurable performance problem with |
Note that I'm not sure doing |
@pintsized In a continuous pressure test of 200 users, An I agree with your And I found an other issue, In my code, I haven't using proxied and transactions for redis, but it would be must call the I have an other changed, when the get master from sentinel, I using cache of master, the Thanks for your help. |
Hello,
I have an auth/select of connection reuse issue.
This my env:
redis-server: 127.0.0.1:6379
auth: 123456
when I connect to redis-server. every connection method all to auth, but the connection may be a pool connection, and it needn't to auth.
I can create a single redis-connector for my code, however, the openresty not allowed to do that, please see:
openresty/lua-resty-redis#44
BTW, Could we do something on get_reused_times() of lua-resty-redis. If the return times > 0, then the connection is reused, so we ignore auth and select?
Please tell me how to working it. Thanks!
The text was updated successfully, but these errors were encountered: