Search code examples
azureazure-cachingazure-redis-cache

Azure Redis Cache - how connections are calculated


Can somebody explains how the connections are calculated in Azure Redis Cache?

For example if I have an MVC app and I use a Basic Redis Cache with 256 connections, and I have 256 users accessing my websites will there be 256 connections made? How exactly does this work?

enter image description here


Solution

  • How many connections are made depends on the application you implement. If you follow best practices, your application will be able to handle many users with a very low amount of connections.

    E.g. Stackexchange.Redis should be able to handle thousands of users without exhausting your 256 connections if you reuse the connection multiplexer object.

    Some more information:

    https://gist.github.com/JonCole/925630df72be1351b21440625ff2671f

    https://stackexchange.github.io/StackExchange.Redis/Basics

    the key idea in StackExchange.Redis is that it aggressively shares the connection between concurrent callers