12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?xml version="1.0" encoding="UTF-8"?>
- <caches>
- <cache name="jedis">
- <cache-class>com.chinacreator.cache.redis.JedisCacheManager</cache-class>
- <!--
- 缓存服务器,格式为ip:port,多个服务器用逗号(,)隔开
- // 生成环境
- <cache-hosts>114.255.201.234:8080</cache-hosts>
- //测试环境
- <cache-hosts>202.106.63.1:6379</cache-hosts>
- -->
- <cache-hosts>114.255.201.234:8080</cache-hosts>
- <!--
- 连接服务器超时时间
- 如果为-1,则表示不限制
- -->
- <cache-connect-timeout>6000</cache-connect-timeout>
- <cache-config>
- <!--
- 连接耗尽时是否阻塞, false报异常,ture阻塞直到超时, 默认true
- -->
- <block-when-exhausted>false</block-when-exhausted>
- <!--
- 设置的逐出策略类名, 默认DefaultEvictionPolicy(当连接超过最大空闲时间,或连接数超过最大空闲连接数)
- -->
- <eviction-policy-class-name>org.apache.commons.pool2.impl.DefaultEvictionPolicy</eviction-policy-class-name>
- <!--
- 是否启用pool的jmx管理功能, 默认true
- -->
- <jmx-name-prefix>pool</jmx-name-prefix>
- <!--
- 是否启用后进先出, 默认tru
- -->
- <lifo>true</lifo>
- <!--
- 最大空闲连接数,默认8个
- -->
- <max-idle>8</max-idle>
- <!--
- 最大连接数, 默认8个
- -->
- <max-total>1024</max-total>
- <!--
- 获取连接时的最大等待毫秒数(如果设置为阻塞时BlockWhenExhausted),如果超时就抛异常, 小于零:阻塞不确定的时间, 默认-1
- -->
- <max-wait-millis>-1</max-wait-millis>
- <!--
- 逐出连接的最小空闲时间 默认1800000毫秒(30分钟)
- -->
- <min-evictable-idle-time-millis>1800000</min-evictable-idle-time-millis>
- <!--
- 每次逐出检查时 逐出的最大数目 如果为负数就是 : 1/abs(n), 默认3
- -->
- <num-tests-per-eviction-run>3</num-tests-per-eviction-run>
- <!--
- 对象空闲多久后逐出, 当空闲时间>该值 且 空闲连接>最大空闲数 时直接逐出,不再根据MinEvictableIdleTimeMillis判断 (默认逐出策略)
- -->
- <soft-min-evictable-idle-time-millis>1800000</soft-min-evictable-idle-time-millis>
- <!--
- 在获取连接的时候检查有效性, 默认false
- -->
- <test-on-borrow>true</test-on-borrow>
- <!--
- 在空闲时检查有效性, 默认false
- -->
- <test-while-idle>true</test-while-idle>
- <!--
- 逐出扫描的时间间隔(毫秒) 如果为负数,则不运行逐出线程, 默认-1
- -->
- <time-between-eviction-runs-millis>-1</time-between-eviction-runs-millis>
- </cache-config>
- </cache>
- </caches>
|