Skip to main content

All Questions

1 vote
1 answer
41 views

How to use LuaScript with dynamic KEYS and ARGV collections in StackExchange.Redis without losing script caching?

I'm using StackExchange.Redis and want to execute a Lua script that performs SADD operations on multiple sets, where both the keys and values are passed dynamically. Here's the Lua script I'm trying ...
Marat's user avatar
  • 23
0 votes
2 answers
244 views

In a Lua script, how to sum up all values returned by Redis TS.RANGE call?

In Azure Redis Enterprise with TimeSeries module enabled I have the following time series with 4 values of 1 at the key "key1": $ TS.RANGE key1 - + 1) 1) (integer) 1693381431951 2) 1 2) ...
Alexander Farber's user avatar
0 votes
1 answer
3k views

Lua redis() command arguments must be strings or integers - however the same command works at redis-cli prompt

There is a command, which works perfectly at my Redis Azure Cache "redis-cli" prompt (an Enterprise E10 instance with the TimeSeries module enabled): EVAL "redis.call('TS.ADD', KEYS[1], ...
Alexander Farber's user avatar
1 vote
1 answer
546 views

Redis lua script - check redis.call('JSON.SET') result

I'm using lua scripting with Redis, using Redis StackExchange library. What I want to accomplish, is to check the result of the execution of JSON.SET, and then return 1 in case it was succesfull, 0 ...
o0mardok0o's user avatar
2 votes
1 answer
708 views

How to call a Redis Function with StackExchange.Redis

I wrote and register this Redis Function: local function stincr(KEYS, ARGS) local value = redis.pcall('INCR', KEYS[1]) if value == 1 or value % 100 == 0 then redis.call('ZADD', ...
n.y's user avatar
  • 3,490
2 votes
2 answers
2k views

Redis StackExchange LuaScripts with parameters

I'm trying to use the following Lua script using C# StackExchange library: private const string LuaScriptToExecute = @" local current current = redis.call(""incr"", KEYS[1]) ...
Ilia's user avatar
  • 328
1 vote
0 answers
462 views

Cache Busting with Redis Clusters

Currently we are using clustered redis. In some instances, we have to delete hundred of thousands of cached objects. I am wondering what's currently the best approach to do so? At the moment we are ...
Master's user avatar
  • 2,163
0 votes
1 answer
559 views

Redis lua script: will my attempt to mix KEYS and generated keys within the script work when clustering (if I'm careful)?

I've searched for an answer to this, and every question doesn't really capture what I am asking. I'm using StackExchange.Redis as a redis client in C# to maintain state in a redis cache that has ...
Darren Sandford's user avatar
1 vote
1 answer
1k views

Execute Lua script to delete all keys matching a pattern on Redis DB via stackexchange.redis

I have a Lua script which deletes all keys matching a pattern. The script is the following: EVAL "return redis.call('del', 'defaultKey', unpack(redis.call('keys', ARGV[1])))" 0 ad:* This ...
Sugafree's user avatar
  • 683
0 votes
1 answer
1k views

How to get the TTL of multiple Redis keys from C# StackExchange.Redis

Trying to make up a function that takes a list of redis keys, and outputs a list of timespans for the time to live (TTL) of the keys. I'm not familiar with Lua Scripting though. I've tried following ...
Pangamma's user avatar
  • 807
1 vote
1 answer
1k views

Can I send HTTP request using lua scripting in redis?

I have a scenario where, when a key which is set in redis reaches a certain count say n, I need to send a HTTP post request, is this possible using Lua scripting in redis? Any help regarding this or ...
Ashay Fernandes's user avatar
0 votes
1 answer
533 views

how to create a high performance counter in c# using lua and redis with stackexchange

I'm trying to create a simple method in c# to get a count of keys in my Redis instance. In redis, I have my keys like: mykey:1 mykey:2 mykey:3 By using redis-cli, I can run: eval "return #redis....
BitQuestions's user avatar
6 votes
1 answer
2k views

How to properly load a Lua script in StackExchange.Redis?

In the StackExchange.Redis docs for scripting, it says a LoadedLuaScript can be used to avoid retransmitting the Lua script to redis each time it is evaluated. It then gives an example where the ...
JontyMC's user avatar
  • 6,068
1 vote
1 answer
1k views

Redis: cache item invalidation based on dependencies?

Is there a native way in Redis to invalidate a cache item when other specified items get removed from the cache? Is there an eviction policy based on dependencies? Here is an example of what I want ...
Angel Paredes's user avatar
0 votes
0 answers
86 views

Can we use StackExchange.Redis without using LUA scripting to connect redis server version 4.0.8?

I need to connect Redis hosted in Pivotal cloud using Stackexchange.Redis.Strongname and Microsoft.Web.Redissessionstate provider dlls from my C# code. Earlier we have used LUA scripting for adding ...
sanoop's user avatar
  • 11

15 30 50 per page