You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Scripts execution always uses EVAL with multi. #2084
for whether to use the EVAL or EVALSHA for script execution.
However, multi is always re-initiated for every transaction or pipeline execution, thus this means the script executed in the multi always end up with a EVAL with the full script uploaded over and over again.
In v3, I used to run "SCRIPT LOAD" for all scripts and then all subsequent commands would use evalsha. And if evalsha fails with NOSCRIPT, then the script is reloaded to redis again. I think redis v4 can implement similar approach and only need to handle the corner case of NOSCRIPT when it arises.
This issue has been automatically marked as stale due to inactivity.
It will be closed in 30 days if no further activity occurs.
If you believe this issue is still relevant, please add a comment to keep it open.
Closing this as not planned. The server already caches a script sent with EVAL, so the cost here is the bytes of the source once per batch. Tracking the server's script cache on the client side would add a way for a MULTI to partly fail with NOSCRIPT (see #3647). If this causes a real cost in your application, please open a new issue with the details.
Activity
marcbachmann commentedon Feb 26, 2024
In ioredis I've solved this by caching script load information using a weakmap against the socket:
https://github.com/redis/ioredis/blob/ec42c82ceab1957db00c5175dfe37348f1856a93/lib/Script.ts#L29-L36
Whenever a custom script command gets execute, it uses either
evalorevalsha.github-actions commentedon Nov 11, 2026
This issue has been automatically marked as stale due to inactivity.
It will be closed in 30 days if no further activity occurs.
If you believe this issue is still relevant, please add a comment to keep it open.
nkaradzhov commentedon Nov 20, 2026
Closing this as not planned. The server already caches a script sent with
EVAL, so the cost here is the bytes of the source once per batch. Tracking the server's script cache on the client side would add a way for aMULTIto partly fail withNOSCRIPT(see #3647). If this causes a real cost in your application, please open a new issue with the details.