6

什么是 Web 场景中 ConnectionMultiplexer 实例的正确生命周期管理。据我了解,它通过流水线管理单个请求,从而减少延迟造成的负面影响。这是否意味着在 Web 应用程序中 ConnectionMultiplexer 应该用作单例而不是更频繁使用的请求范围?

4

1 回答 1

8

Essentially, yes - you should rarely need more than one multiplexer to the same Redis nodes. This is also described here. Note that the database object from GetDatabase is very cheap, and can be per request or per method-scope if needed (per-rewuest plays very nicely for multi-tenancy scenarios where different tenants are on different database numbers)

于 2014-09-14T12:08:47.297 回答