mycat1.6.7 非分片字段查询the max activeConnnections size can not be max than maxconnections
时间: 2024-02-18 11:00:46 浏览: 37
在 MyCat 1.6.7 中进行非分片字段查询时,同样需要确保 maxActiveConnections 不超过 maxConnections 所设置的值,否则可能会出现连接泄漏等问题。
在 MyCat 1.6.7 中,连接池的配置文件为 server.xml,您可以在该文件中找到以下配置项:
```
<!-- 连接池配置 -->
<dataSource name="ds1" type="c3p0">
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="jdbcUrl">jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8</property>
<property name="user">root</property>
<property name="password">123456</property>
<property name="initialPoolSize">10</property>
<property name="minPoolSize">10</property>
<property name="maxPoolSize">100</property>
<property name="acquireIncrement">5</property>
<property name="acquireRetryAttempts">3</property>
<property name="acquireRetryDelay">1000</property>
<property name="maxIdleTime">60</property>
<property name="testConnectionOnCheckin">true</property>
<property name="idleConnectionTestPeriod">60</property>
</dataSource>
```
在上面的配置中,maxPoolSize 表示连接池中最大连接数,initialPoolSize 表示连接池中初始化连接数,minPoolSize 表示连接池中最小连接数,maxIdleTime 表示连接的最大空闲时间,acquireIncrement 表示连接池自动增长的步长,acquireRetryAttempts 表示连接池获取连接的重试次数,acquireRetryDelay 表示连接池获取连接的重试间隔时间,testConnectionOnCheckin 表示连接池在归还连接时是否进行连接测试,idleConnectionTestPeriod 表示连接池对空闲连接进行测试的时间间隔。
您可以根据实际需求进行修改,但需要确保 maxActiveConnections 不超过 maxConnections 所设置的值。