For StackExchange.Redis connection pool
solve timeout prolem:
Was there a big request preceding several small requests to the Redis that timed out? https://github.com/StackExchange/StackExchange.Redis/blob/master/docs/Timeouts.md
Install-Package StackExchange.Redis.ConnectionPool
add dependency inject to IServiceCollection
collection.AddRedisConnectionPool("localhost:6379", 10);
OR
collection.AddRedisConnectionPool(option=>{
// todo config
}, 10);
the more config infomation,look at StackEchange.Redis
doc:https://stackexchange.github.io/StackExchange.Redis/Configuration
if you need one connection object per scope(like one user one request)
direct use inject object: IConnectionMultiplexer
if you need pool (for Parallel case)
use pool object : ObjectPool<PooledConnectionMultiplexer>