Questions tagged [stackexchange.redis]

A high performance .NET redis client library

StackExchange.Redis is a high-performance redis client library for .NET and Mono applications, allowing massively concurrent usage from multiple threads (for example, on a busy web site). The library exposes synchronous, asynchronous and fire-and-forget APIs, allowing it to support a wide variety of use-cases. Additionally, the client supports internal management of connections to multiple servers, including both master/slave setups and redis "cluster". The entire set of redis functionality is included (including auto-resubscribe for pub/sub connections), with the exception of the blocking pop operations, which are not compatible with the multiplexer design.

The client was designed, created and released by the Stack Exchange development team, and is the redis client that drives the Stack Exchange Network (including Stack Overflow). It supersedes the BookSleeve client that Stack Exchange had been using previously

Links:

1108 questions
76
votes
2 answers

Deadlock when accessing StackExchange.Redis

I'm running into a deadlock situation when calling StackExchange.Redis. I don't know exactly what is going on, which is very frustrating, and I would appreciate any input that could help resolve or workaround this problem. In case you have this…
Mårten Wikström
  • 11,074
  • 5
  • 47
  • 87
59
votes
5 answers

Remove/Delete all/one item from StackExchange.Redis cache

I am using StackExchange.Redis client with Azure Redis Cache Service. Here is my class, public class RedisCacheService : ICacheService { private readonly ISettings _settings; private readonly IDatabase _cache; public…
Imran Qadir Baksh - Baloch
  • 32,612
  • 68
  • 179
  • 322
45
votes
1 answer

StackExchange.Redis timeout and "No connection is available to service this operation"

I have the following issues in our production environment (Web-Farm - 4 nodes, on top of it Load balancer): 1) Timeout performing HGET key, inst: 3, queue: 29, qu=0, qs=29, qc=0, wr=0/0 at…
Yuriy Anisimov
  • 825
  • 1
  • 7
  • 16
41
votes
2 answers

StackExchange.Redis - LockTake / LockRelease Usage

I am using Redis with StackExchange.Redis. I have multiple threads that will at some point access and edit the value of the same key, so I need to synchronize the manipulation of the data. Looking at the available functions, I see that there are…
lolcodez
  • 659
  • 4
  • 9
  • 16
39
votes
3 answers

What is the difference between StackExchange.Redis and StackExchange.Redis.StrongName?

While I was following Azure documentation for how to use Redis Cache in Azure Portal I noticed this note: If you prefer to use a strong-named version of the StackExchange.Redis client library, choose StackExchange.Redis.StrongName; otherwise …
Mohamed Farrag
  • 1,682
  • 2
  • 19
  • 41
38
votes
1 answer

Difference between StackExchange.Redis and ServiceStack.Redis

Someone can explain the difference about ServiceStack.Redis and StackExchange.Redis c# libraries?
Bruno Brito
  • 389
  • 1
  • 4
  • 5
28
votes
6 answers

Get all keys from Redis Cache database

I am using Redis cache for caching purpose (specifically stackexchange.Redis C# driver. Was wondering is there any ways to get all the keys available in cache at any point in time. I mean the similar thing I can do in ASP.NET cache object (below…
Rahul
  • 76,197
  • 13
  • 71
  • 125
26
votes
2 answers

Pipelining vs Batching in Stackexchange.Redis

I am trying to insert a large(-ish) number of elements in the shortest time possible and I tried these two alternatives: 1) Pipelining: List addTasks = new List(); for (int i = 0; i < table.Rows.Count; i++) { DataRow row =…
CyberDude
  • 8,541
  • 5
  • 29
  • 47
26
votes
3 answers

How to store user defined objects using StackExchange.Redis?

I was able to do this in ServiceStack.redis by using, IRedisTypedClient myObj = redisClient.As(); But I couldn't find any examples to do this in StackExchange.Redis. Do I have to Serialize to JSON and then store them? Thanx…
Gayan Jayasingha
  • 752
  • 2
  • 17
  • 33
25
votes
3 answers

What are the key difference in using Redis Cache via ConnectionMultiplexer and AddStackExchangeRedisCache(IDistributedCache) in StartUp.cs?

I want to implement Distributed caching(Redis) in ASP.NET Core project. After a bit or research I found that there are two ways of creating a Redis connection using AddStackExchangeRedisCache in Startup.cs and…
Ankit Jain
  • 351
  • 1
  • 3
  • 5
25
votes
3 answers

StackExchange.Redis transaction methods freezes

I have this code to add object and index field in Stackexchange.Redis. All methods in transaction freeze thread. Why ? var transaction = Database.CreateTransaction(); //this line freeze thread. WHY ? await…
boostivan
  • 279
  • 4
  • 9
24
votes
3 answers

StackExchange.Redis simple C# Example

I am looking for a very simple starter C# application for using StackExchange.Redis I have search over the web and found StackExchange.Redis But this doesn't seems like a quick startup example. I have setup redis on windows using…
hellowahab
  • 2,445
  • 4
  • 21
  • 34
22
votes
3 answers

How to store list element in Redis cache

I have used StackExchange.Redis for c# redis cache. cache.StringSet("Key1", CustomerObject); but I want to store data like cache.StringSet("Key1", ListOfCustomer); so that one key has all Customer List stored and it is easy to …
Neo
  • 15,491
  • 59
  • 215
  • 405
22
votes
2 answers

How does ConnectionMultiplexer deal with disconnects?

The Basic Usage documentation for StackExchange.Redis explains that the ConnectionMultiplexer is long-lived and is expected to be reused. But what about when the connection to the server is broken? Does ConnectionMultiplexer automatically reconnect,…
Gigi
  • 28,163
  • 29
  • 106
  • 188
22
votes
2 answers

Redis Stack Exchange how to delete or get keys by pattern

I installed Stack Exchange redis client in C#. I can only delete one key or array of keys but I don't know how to delete keys with prefix. Or another solution can be first get all keys by pattern and then delete them. But I don't know how to get…
Robert
  • 2,571
  • 10
  • 63
  • 95
1
2 3
73 74