-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Poor performance of session.UpdateExpiration on 200 thousands+ keys with new radix lib #1328
Comments
No there is no difference in the commands themselves. Bbecause underline the radix library adds a args = append(args, cursor)
if o.Pattern != "" {
args = append(args, "MATCH", o.Pattern)
} The only difference between versions is the library replacement, I am thinking if we should provide an option for both of these libraries? @r3eg |
@kataras Yes, I saw MATCH command in radix lib, but just now I executed the same command (search by sid_* pattern) in Redis Desktop Manager and this command executed instantly, but 30 seconds+ in getKeys method... |
Can you test to run using the older version of redis(just copy-paste the old sessiondb/redis files and make some changes on the configuration)? Maybe the problem is on unmarshal |
@kataras this cycle is executed several seconds on each key inside radix lib
|
@kataras Makis, I have tested get keys on old redis module (just copy-paste it in service.go) and it works instantly. This is the part of code:
getKeysConn does the same but no delay at all... |
I see, so the previously used OK, so I will revert it and get back to the Sounds good? |
@kataras Yes, sounds good (it is advisable to maintain compatibility with new modules as much as possible) I have nothing against radix, but this problem immediately got out on prod server. It might be worth using the optional redigo or radix depending on your specific goals. |
Yes, it will be like |
@kataras Yes, it will be a good solution with config.Driver |
Yes, it will default to 'redigo' though but without any breaking changes and this gives us the chance to support more redis clients in the future without the requirement of a, whole, new sessiondb for the same backend service (redis). |
@kataras Ok Makis! Thank you for fast support! |
I thank YOU @r3eg, always! It's done. Could you please test it before I push the v11.2.4 which has some other fixes and a new feature too? go get github.com/kataras/iris@master iris/_examples/sessions/database/redis/main.go Lines 16 to 33 in 7f64919
|
@kataras Thanks again Makis! Just tested now, seems to works fine. Tomorrow will be more complicated testing, but now I have no problem with compatibility, so just pulled your commit and now it works instantly! |
You are welcome @r3eg, it was a good report and you helped me a lot, so many thanks to you, you did actually fix that issue not me :) We'll wait until tomorrow then, no problem! |
@kataras Hello Makis! Today I pushed changes to prod server, all works fine now, no problem with perfomance at all! Thank you again! |
@r3eg that's nice! I think I found the issue on radix, it is calling a new scan command based on the returned cursor from the |
yes it is true . Bravo. Good point |
Yeah, I pushed the commit. The COUNT is 300 thousand and it iterates until cursor returned by redis is |
…t) and radix - rel to: kataras#1328 Former-commit-id: 1eee58f2c49f64899fffc3ad61bcf074f8949cc1
Former-commit-id: a2519c17a039b67129bd5683e9e9a1239c441c0a
Former-commit-id: beaf1f301ba8967fb7b56dc670818dedda324819
Hello Makis!
I have more 200 thousands key in redis on prod server and found that after upgrading iris on v11 from redigo to radix lib that I have problems with perfomance when calling session.UpdateExpiration method (it`s executing minimum 10 seconds on a powerful prod server and more than 30 seconds on usual local).
While debugging I found place where freezes, it`s here:
and inside getKeys here:
Just has watched old v10 iris and old method getKeysConn did not cause such delay ...
Maybe reason in difference between old and new scan commands? Could you help?
The text was updated successfully, but these errors were encountered: