StackExchange.Redis ConnectionMultiplexer Lifecycle Management in Web Script

What is the proper lifecycle management of a ConnectionMultiplexer instance in a web script. As far as I understand, it manages individual requests by pipelining them and thus reduces the negative effect caused by latency. Does this mean that in the web application ConnectionMultiplexer should be used as a single, and not in the more commonly used request area?

+6
source share
1 answer

Essentially, yes — you rarely need more than one multiplexer for the same Redis node. It is also described here . Please note that the database object from GetDatabase is very cheap, and may be per query or method scope if necessary (per-reuuest is perfect for multi-tenant scenarios when different tenants are on different database numbers)

+8
source

Source: https://habr.com/ru/post/1202528/


All Articles