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
why evalsha can not improve performance #3801
Comments
(D'oh! I managed to post & delete a comment, so here once again) Can't reproduce that locally:
If you see different results you might want to post those and maybe look into other factors of your system as well. |
$ cat s.lua $ redis-cli -x script load < s.lua $ redis-benchmark eval "$(<s.lua)" 1 r3c_eval_0 f0 0 f1 1 f2 2 f3 3 f4 4 f5 5 f6 6 f7 7 f8 8 f9 9 |tail -2 |head -1 $ redis-benchmark evalsha "b91594bd37521716af19905a9ae0d3fc9c62a037" 1 r3c_eval_0 f0 0 f1 1 f2 2 f3 3 f4 4 f5 5 f6 6 f7 7 f8 8 f9 9 |tail -2 |head -1 |
EVALSHA slower than EXPIRE & SETNX
|
DO you have certain answer for this issue. |
confirmed that EVALSHA is behaving as expected on a stable env with 2 VMs.
marking this issue to be closed.
EVALSHA
|
Need atomic multi hincryby by lua scripts.
evalsha slower than eval:
EVAL:
local j=1;local results={};for i=1,#ARGV,2 do local f=ARGV[i];local v=ARGV[i+1];results[j]=redis.call('hincrby','r3c_eval_0',f,v);j=j+1; end;return results;
EVALSHA:
local j=1;local results={};for i=1,#ARGV,2 do local f=ARGV[i];local v=ARGV[i+1];results[j]=redis.call('hincrby','r3c_eval_0',f,v);j=j+1; end;return results;
The text was updated successfully, but these errors were encountered: