1

My application is configured as follows:

@Bean
public RedisConnectionFactory redisConnectionFactory() {
        PoolConfig poolConfig = new PoolConfig(10, 200);// maxPoolSize=10
        return connectionFactory().redisConnectionFactory("REDISCLOUD", new PooledServiceConnectorConfig(poolConfig));
    }

The entry plan for REDISCLOUD indicates a maximum of 10 Redis connections.

However, I have two running dynos at the moment and I might have more than two in the future. Does that mean that my app can consumes 2 dynos * 10 connections = 20 Redis connections at the moment?

If that is the case that's an issue and I am not sure how to configure my pool for instance if I increase the number of running dynos...

By the way the issue is the same with relational database connectors...

Can someone please advise?

4

1 回答 1

2

免责声明:我在 Redis Labs 工作,它是 Heroku 的 Redis Cloud 插件提供商。

你是对的 - 如果每个测功机的池增长到最大值,此设置将需要 20 个连接。与数据库的连接被认为是一种“昂贵的”资源——对于客户端和服务器都是如此。这正是应用程序使用连接池的原因……以及 Redis Labs 等数据库提供商需要对其收费的原因。

解决此问题的一种方法是升级您的 Redis Cloud 附加计划以满足您的连接要求:) 付费计划更加宽松,从 2.5GB 计划开始,您可以获得无限数量的连接。使用其中之一,您可以不必担心扩展:https ://addons.heroku.com/rediscloud#2500

于 2015-05-02T13:40:24.490 回答