From a06ae2c835ba5837677e7d9e83f4b98f8ac2f587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Mon, 8 Sep 2025 11:21:32 +0300 Subject: [PATCH] perf(cache): use redis unlink for key deletion (#10658) # Which Problems Are Solved The usage of the Redis `DEL` command showed blocking and slowdowns during load-tests. # How the Problems Are Solved Use [`UNLINK`](https://redis.io/docs/latest/commands/UNLINK/) instead. # Additional Changes - none # Additional Context - closes https://github.com/zitadel/zitadel/issues/8930 --- internal/cache/connector/redis/_remove.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/cache/connector/redis/_remove.lua b/internal/cache/connector/redis/_remove.lua index cbd7f5a797b..301bafc479a 100644 --- a/internal/cache/connector/redis/_remove.lua +++ b/internal/cache/connector/redis/_remove.lua @@ -3,8 +3,8 @@ local function remove(object_id) local keys = redis.call("SMEMBERS", setKey) local n = #keys for i = 1, n do - redis.call("DEL", keys[i]) + redis.call("UNLINK", keys[i]) end - redis.call("DEL", setKey) - redis.call("DEL", object_id) + redis.call("UNLINK", setKey) + redis.call("UNLINK", object_id) end